Class IntegrityProcessor
java.lang.Object
com.github.darksoulq.abyssallib.world.structure.processor.StructureProcessor
com.github.darksoulq.abyssallib.world.structure.processor.impl.IntegrityProcessor
A structure processor that applies a chance-based filter to block placement.
This processor mimics the "Integrity" setting found in vanilla Minecraft structure blocks. For each block in the structure, a random roll is performed; if the roll exceeds the integrity value, the block is skipped (returned as null), creating a decayed or eroded effect.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<IntegrityProcessor> The codec used for serializing and deserializing the integrity processor.static final StructureProcessorType<IntegrityProcessor> The registered type definition for the integrity structure processor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetType()Retrieves the specific type definition for this processor.process(WorldGenAccess level, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block placement in a world generation context.Processes a block placement in a standard world context.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the integrity processor.It handles the "integrity" float field, which represents the placement probability between 0.0 and 1.0.
-
TYPE
The registered type definition for the integrity structure processor.
-
-
Constructor Details
-
IntegrityProcessor
public IntegrityProcessor(float integrity) Constructs a new IntegrityProcessor.- Parameters:
integrity- The placement chance. 1.0 means all blocks place; 0.5 means half are skipped.
-
-
Method Details
-
process
public BlockInfo process(org.bukkit.World world, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block placement in a standard world context.Performs a random float check against the integrity threshold.
- Specified by:
processin classStructureProcessor- Parameters:
world- The Bukkit world.origin- The structure origin.current- The currentBlockInfo.original- The originalBlockInfo.- Returns:
- The
currentblock info if the check passes, ornullto skip placement.
-
process
public BlockInfo process(WorldGenAccess level, org.bukkit.Location origin, BlockInfo current, BlockInfo original) Processes a block placement in a world generation context.Performs a random float check against the integrity threshold.
- Specified by:
processin classStructureProcessor- Parameters:
level- The generation accessor.origin- The structure origin.current- The currentBlockInfo.original- The originalBlockInfo.- Returns:
- The
currentblock info if the check passes, ornullto skip placement.
-
getType
Retrieves the specific type definition for this processor.- Specified by:
getTypein classStructureProcessor- Returns:
- The
StructureProcessorTypeassociated withIntegrityProcessor.
-