Class StructureProcessor
java.lang.Object
com.github.darksoulq.abyssallib.world.structure.processor.StructureProcessor
- Direct Known Subclasses:
BlockIgnoreProcessor, IntegrityProcessor
The base class for all structure processors.
Processors are executed in a pipeline during structure placement. Each processor
can modify the block being placed, change its properties, or return
null
to prevent the block from being placed entirely.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<StructureProcessor> Polymorphic codec for serializing and deserializing structure processors. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StructureProcessorType<?> getType()Retrieves the structure processor type associated with this specific implementation.abstract BlockInfoprocess(WorldGenAccess level, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block during world generation placement.abstract BlockInfoProcesses a block during standard world placement.
-
Field Details
-
CODEC
Polymorphic codec for serializing and deserializing structure processors. It uses the "type" field to identify the processor implementation registered withinRegistries.PROCESSOR_TYPES.
-
-
Constructor Details
-
StructureProcessor
public StructureProcessor()
-
-
Method Details
-
process
@Nullable public abstract BlockInfo process(org.bukkit.World world, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block during standard world placement.- Parameters:
world- The BukkitWorldwhere the structure is being placed.origin- The originLocationof the structure placement.current- The currentBlockInfoas modified by previous processors in the stack.original- The originalBlockInfoas defined in the source structure file.- Returns:
- The modified
BlockInfo, ornullto skip placement of this specific block.
-
process
@Nullable public abstract BlockInfo process(WorldGenAccess level, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block during world generation placement.- Parameters:
level- TheWorldGenAccessproviding thread-safe access during world generation.origin- The originLocationof the structure placement.current- The currentBlockInfoas modified by previous processors.original- The originalBlockInfoas saved in the structure file.- Returns:
- The modified
BlockInfo, ornullto skip placement.
-
getType
Retrieves the structure processor type associated with this specific implementation. This is primarily used for serialization via the polymorphic codec.- Returns:
- The
StructureProcessorTypeidentifying this processor.
-