Interface IPlacementContext

All Known Subinterfaces:
IStructureHandler
All Known Implementing Classes:
AbstractStructureHandler, CreativeStructureHandler, SimplePlacementContext

public interface IPlacementContext
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    If this is supposed to be fancy placement (player facing) or builder facing (complete).
    Get the bluerint from the handler.
    net.minecraft.core.BlockPos
    Get the world position this is placed at.
    Getter for the placement settings.
    net.minecraft.world.level.block.state.BlockState
    getSolidBlockForPos(net.minecraft.core.BlockPos worldPos, Function<net.minecraft.core.BlockPos,@Nullable net.minecraft.world.level.block.state.BlockState> virtualBlocks)
    Get the solid worldgen block for given pos while using data from handler.
  • Method Details

    • getRotationMirror

      RotationMirror getRotationMirror()
      Getter for the placement settings.
      Returns:
      the settings object.
    • fancyPlacement

      boolean fancyPlacement()
      If this is supposed to be fancy placement (player facing) or builder facing (complete).
      Returns:
      true if fancy placement.
    • getSolidBlockForPos

      net.minecraft.world.level.block.state.BlockState getSolidBlockForPos(net.minecraft.core.BlockPos worldPos, Function<net.minecraft.core.BlockPos,@Nullable net.minecraft.world.level.block.state.BlockState> virtualBlocks)
      Get the solid worldgen block for given pos while using data from handler.
      Parameters:
      worldPos - the world pos.
      virtualBlocks - blueprint blocks, fnc may return null if virtual block is not available (then use level instead for getting surrounding block states), pos argument is using world coords
      Returns:
      the solid worldgen block (classically biome dependent).
    • getCenterPos

      net.minecraft.core.BlockPos getCenterPos()
      Get the world position this is placed at.
      Returns:
      the position.
    • getBluePrint

      Blueprint getBluePrint()
      Get the bluerint from the handler.
      Returns:
      the blueprint