Class StructurePlacer
java.lang.Object
com.ldtteam.structurize.placement.StructurePlacer
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IStructureHandlerThe handler.protected final AbstractBlueprintIteratorThe structure iterator. -
Constructor Summary
ConstructorsConstructorDescriptionStructurePlacer(IStructureHandler handler) Create a new structure placer.StructurePlacer(IStructureHandler handler, String id) Create a new structure placer. -
Method Summary
Modifier and TypeMethodDescriptionexecuteStructureStep(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.Get the handler instance.Get the iterator instance.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.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.handleEntitySpawn(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, net.minecraft.core.BlockPos localPos, ChangeStorage storage) This method handles entity spawning.booleanisReady()Check if the structure placer is ready.
-
Field Details
-
iterator
The structure iterator. -
handler
The handler.
-
-
Constructor Details
-
StructurePlacer
Create a new structure placer.- Parameters:
handler- the structure handler.
-
StructurePlacer
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 posstorage- 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 posstorage- 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
Get the iterator instance.- Returns:
- the BlueprintIterator.
-
getHandler
Get the handler instance.- Returns:
- the IStructureHandler.
-
isReady
public boolean isReady()Check if the structure placer is ready.- Returns:
- true if so.
-