Interface IPlacementHandler
- All Known Implementing Classes:
PlacementHandlers.AirPlacementHandler,PlacementHandlers.BannerPlacementHandler,PlacementHandlers.BedPlacementHandler,PlacementHandlers.BlockGrassPathPlacementHandler,PlacementHandlers.ContainerPlacementHandler,PlacementHandlers.DoorPlacementHandler,PlacementHandlers.DoublePlantPlacementHandler,PlacementHandlers.DripStoneBlockPlacementHandler,PlacementHandlers.FallingBlockPlacementHandler,PlacementHandlers.FirePlacementHandler,PlacementHandlers.FlowerPotPlacementHandler,PlacementHandlers.FluidSubstitutionPlacementHandler,PlacementHandlers.GeneralBlockPlacementHandler,PlacementHandlers.GrassPlacementHandler,PlacementHandlers.HopperClientLagPlacementHandler,PlacementHandlers.SpecialBlockPlacementAttemptHandler,PlacementHandlers.StairBlockPlacementHandler
public interface IPlacementHandler
Handler for all kinds of placements.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPossible result of an IPlacementHandler call. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState) Check if a placement handler can handle a certain block.List<net.minecraft.world.item.ItemStack>getRequiredItems(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete) Method used to get the required items to place a block.handle(Blueprint blueprint, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos, RotationMirror settings) Method used to handle the processing of a Placement of a block.handle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos) Method used to handle the processing of a Placement of a block.handle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos, RotationMirror settings) Method used to handle the processing of a Placement of a block.default voidhandleRemoval(IStructureHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Handles the removal of the existing block in the worlddefault voidhandleRemoval(IStructureHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.nbt.CompoundTag tileEntityData) Handles the removal of the existing block in the world
-
Method Details
-
canHandle
boolean canHandle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState) Check if a placement handler can handle a certain block.- Parameters:
world- the world.pos- the position.blockState- the blockState.- Returns:
- true if so.
-
handle
default IPlacementHandler.ActionProcessingResult handle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos) Method used to handle the processing of a Placement of a block.- Parameters:
world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.complete- place it complete (with or without substitution blocks etc).centerPos- centerPos the central position of it.- Returns:
- ACCEPT, DENY or IGNORE.
-
handle
default IPlacementHandler.ActionProcessingResult handle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos, RotationMirror settings) Method used to handle the processing of a Placement of a block.- Parameters:
world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.complete- place it complete (with or without substitution blocks etc).centerPos- the central position of it.settings- the settings to use to rotate or mirror it.- Returns:
- ACCEPT, DENY or IGNORE.
-
handle
default IPlacementHandler.ActionProcessingResult handle(Blueprint blueprint, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete, net.minecraft.core.BlockPos centerPos, RotationMirror settings) Method used to handle the processing of a Placement of a block.- Parameters:
blueprint- the blueprint.world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.complete- place it complete (with or without substitution blocks etc).centerPos- the central position of it.settings- the settings to use to rotate or mirror it.- Returns:
- ACCEPT, DENY or IGNORE.
-
handleRemoval
default void handleRemoval(IStructureHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.nbt.CompoundTag tileEntityData) Handles the removal of the existing block in the world- Parameters:
handler- the actor removing the blockworld- the world this block belongs topos- the position of the blocktileEntityData- any tile entity data in the blueprint
-
handleRemoval
default void handleRemoval(IStructureHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Handles the removal of the existing block in the world- Parameters:
handler- the actor removing the blockworld- the world this block belongs topos- the position of the block
-
getRequiredItems
List<net.minecraft.world.item.ItemStack> getRequiredItems(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, boolean complete) Method used to get the required items to place a block.- Parameters:
world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.complete- place it complete (with or without substitution blocks etc).- Returns:
- the list of items.
-