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.
    • StructurePlacer

      public StructurePlacer(IStructureHandler handler, AbstractBlueprintIterator iterator)
      Create a new structure placer
      Parameters:
      handler - the structure handler
      iterator - The iterator to use. It will be reset before it is used
  • 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, ChangeStorage storage, BlockInfo blockInfo)
      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.
      storage - the change storage.
      blockInfo - 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.
    • clearWaterStep

      public StructurePhasePlacementResult clearWaterStep(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos inputPos)
      Clear water of a y layer.
      Parameters:
      world - world to clear it from.
      inputPos - current progress pos.
      Returns:
      progress report.
    • 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.