Class DoBlockPlacementHandler

java.lang.Object
com.ldtteam.structurize.placement.handlers.placement.DoBlockPlacementHandler
All Implemented Interfaces:
IPlacementHandler

public class DoBlockPlacementHandler 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandle(@NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState blockState)
    Check if a placement handler can handle a certain block.
    static boolean
    compareBEData(net.minecraft.util.Tuple<net.minecraft.world.level.block.entity.BlockEntity,net.minecraft.nbt.CompoundTag> blockEntityData)
    Check if the Block Entity data matches for DO blocks.
    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 IPlacementContext structureHandler)
    Method used to compare blueprint state with world state to detect if changes are necessary.
    List<net.minecraft.world.item.ItemStack>
    getRequiredItems(@NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, @NotNull IPlacementContext placementContext)
    Method used to get the required items to place a block.
    handle(@NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.nbt.CompoundTag tileEntityData, @NotNull IPlacementContext placementContext)
    Method used to handle the processing of a Placement of a block.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.ldtteam.structurize.placement.handlers.placement.IPlacementHandler

    handleRemoval
  • Constructor Details

    • DoBlockPlacementHandler

      public DoBlockPlacementHandler()
  • Method Details

    • canHandle

      public boolean canHandle(@NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState)
      Description copied from interface: IPlacementHandler
      Check if a placement handler can handle a certain block.
      Specified by:
      canHandle in interface IPlacementHandler
      Parameters:
      world - the world.
      pos - the position.
      blockState - the blockState.
      Returns:
      true if so.
    • handle

      public IPlacementHandler.ActionProcessingResult handle(@NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, @NotNull @NotNull IPlacementContext placementContext)
      Description copied from interface: IPlacementHandler
      Method used to handle the processing of a Placement of a block.
      Specified by:
      handle in interface IPlacementHandler
      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.
    • 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: IPlacementHandler
      Method used to compare blueprint state with world state to detect if changes are necessary.
      Specified by:
      doesWorldStateMatchBlueprintState in interface IPlacementHandler
      Returns:
      true if world state matches blueprint state.
    • compareBEData

      public static boolean compareBEData(net.minecraft.util.Tuple<net.minecraft.world.level.block.entity.BlockEntity,net.minecraft.nbt.CompoundTag> blockEntityData)
      Check if the Block Entity data matches for DO blocks.
      Parameters:
      blockEntityData - check on the block entity textures.
      Returns:
      true if so.
    • getRequiredItems

      public List<net.minecraft.world.item.ItemStack> getRequiredItems(@NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.CompoundTag tileEntityData, @NotNull @NotNull IPlacementContext placementContext)
      Description copied from interface: IPlacementHandler
      Method used to get the required items to place a block.
      Specified by:
      getRequiredItems in interface IPlacementHandler
      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.
    • handleRemoval

      public void handleRemoval(IStructureHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Description copied from interface: IPlacementHandler
      Handles the removal of the existing block in the world
      Specified by:
      handleRemoval in interface IPlacementHandler
      Parameters:
      handler - the actor removing the block
      world - the world this block belongs to
      pos - the position of the block