Class PlacementHandlers.SpecialBlockPlacementAttemptHandler
java.lang.Object
com.ldtteam.structurize.placement.handlers.placement.PlacementHandlers.SpecialBlockPlacementAttemptHandler
- All Implemented Interfaces:
IPlacementHandler
- Enclosing class:
PlacementHandlers
public static class PlacementHandlers.SpecialBlockPlacementAttemptHandler
extends Object
implements IPlacementHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ldtteam.structurize.placement.handlers.placement.IPlacementHandler
IPlacementHandler.ActionProcessingResult -
Constructor Summary
Constructors -
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.booleandoesWorldStateMatchBlueprintState(net.minecraft.world.level.block.state.BlockState worldState, net.minecraft.world.level.block.state.BlockState blueprintState, net.minecraft.util.Tuple<net.minecraft.world.level.block.entity.BlockEntity, net.minecraft.nbt.CompoundTag> blockEntityData, @NotNull IPlacementContext structureHandler) Method used to compare blueprint state with world state to detect if changes are necessary.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, IPlacementContext placementContext) Method used to get the required items to place 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, IPlacementContext placementContext) Method used to handle the processing of a Placement of a block.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ldtteam.structurize.placement.handlers.placement.IPlacementHandler
handleRemoval, handleRemoval
-
Constructor Details
-
SpecialBlockPlacementAttemptHandler
public SpecialBlockPlacementAttemptHandler()
-
-
Method Details
-
canHandle
public boolean canHandle(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState) Description copied from interface:IPlacementHandlerCheck if a placement handler can handle a certain block.- Specified by:
canHandlein interfaceIPlacementHandler- Parameters:
world- the world.pos- the position.blockState- the blockState.- Returns:
- true if so.
-
handle
public 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, IPlacementContext placementContext) Description copied from interface:IPlacementHandlerMethod used to handle the processing of a Placement of a block.- Specified by:
handlein interfaceIPlacementHandler- Parameters:
world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.placementContext- extended placement context.- Returns:
- ACCEPT, DENY or IGNORE.
-
getRequiredItems
public 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, IPlacementContext placementContext) Description copied from interface:IPlacementHandlerMethod used to get the required items to place a block.- Specified by:
getRequiredItemsin interfaceIPlacementHandler- Parameters:
world- receives the world.pos- the position.blockState- the blockState.tileEntityData- the placer of the block.placementContext- the placement context.- Returns:
- the list of items.
-
doesWorldStateMatchBlueprintState
public boolean doesWorldStateMatchBlueprintState(net.minecraft.world.level.block.state.BlockState worldState, net.minecraft.world.level.block.state.BlockState blueprintState, net.minecraft.util.Tuple<net.minecraft.world.level.block.entity.BlockEntity, net.minecraft.nbt.CompoundTag> blockEntityData, @NotNull @NotNull IPlacementContext structureHandler) Description copied from interface:IPlacementHandlerMethod used to compare blueprint state with world state to detect if changes are necessary.- Specified by:
doesWorldStateMatchBlueprintStatein interfaceIPlacementHandler- Returns:
- true if world state matches blueprint state.
-