Class StructurePlacer

java.lang.Object
com.ldtteam.structurize.placement.StructurePlacer

public class StructurePlacer extends Object
Structure placement class that will actually execute the placement of a structure. It will iterate for different phases over the structure and maintain the iterator.
  • Field Details

  • Constructor Details

    • StructurePlacer

      public StructurePlacer(IStructureHandler handler)
      Create a new structure placer.
      Parameters:
      handler - the structure handler.
    • StructurePlacer

      public StructurePlacer(IStructureHandler handler, String id)
      Create a new structure placer.
      Parameters:
      handler - the structure handler.
      id - the unique id of the handler.
  • Method Details

    • executeStructureStep

      public StructurePhasePlacementResult executeStructureStep(net.minecraft.world.level.Level world, ChangeStorage storage, net.minecraft.core.BlockPos inputPos, StructurePlacer.Operation operation, Supplier<AbstractBlueprintIterator.Result> iterateFunction, boolean includeEntities)
      Execute structure placement.
      Parameters:
      world - the world.
      storage - the change storage.
      inputPos - the pos to start from.
      operation - the operation to execute.
      iterateFunction - the function to iterate.
      includeEntities - if entities should be included.
      Returns:
      the result.
    • handleBlockPlacement

      public BlockPlacementResult handleBlockPlacement(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, net.minecraft.core.BlockPos localPos, ChangeStorage storage, net.minecraft.world.level.block.state.BlockState localState, net.minecraft.nbt.CompoundTag tileEntityData)
      This method handles the block placement. When we extract this into another mod, we have to override the method.
      Parameters:
      world - the world.
      worldPos - the world position.
      localPos - the local pos
      storage - the change storage.
      localState - the local state.
      tileEntityData - the tileEntity.
    • handleEntitySpawn

      public BlockPlacementResult handleEntitySpawn(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, net.minecraft.core.BlockPos localPos, ChangeStorage storage)
      This method handles entity spawning. When we extract this into another mod, we have to override the method.
      Parameters:
      world - the world.
      worldPos - the world position.
      localPos - the local pos
      storage - the change storage.
    • getResourceRequirements

      public BlockPlacementResult getResourceRequirements(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, net.minecraft.core.BlockPos localPos, net.minecraft.world.level.block.state.BlockState localState, net.minecraft.nbt.CompoundTag tileEntityData)
      This method handles the block placement. When we extract this into another mod, we have to override the method.
      Parameters:
      world - the world.
      worldPos - the world position.
      localPos - the local pos.
      localState - the local state.
      tileEntityData - the tileEntity.
    • getIterator

      public AbstractBlueprintIterator getIterator()
      Get the iterator instance.
      Returns:
      the BlueprintIterator.
    • getHandler

      public IStructureHandler getHandler()
      Get the handler instance.
      Returns:
      the IStructureHandler.
    • isReady

      public boolean isReady()
      Check if the structure placer is ready.
      Returns:
      true if so.