Class StructureProcessor

java.lang.Object
com.github.darksoulq.abyssallib.world.structure.processor.StructureProcessor
Direct Known Subclasses:
BlockIgnoreProcessor, IntegrityProcessor

public abstract class StructureProcessor extends Object
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 Details

    • CODEC

      public static final Codec<StructureProcessor> CODEC
      Polymorphic codec for serializing and deserializing structure processors. It uses the "type" field to identify the processor implementation registered within Registries.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 Bukkit World where the structure is being placed.
      origin - The origin Location of the structure placement.
      current - The current BlockInfo as modified by previous processors in the stack.
      original - The original BlockInfo as defined in the source structure file.
      Returns:
      The modified BlockInfo, or null to 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 - The WorldGenAccess providing thread-safe access during world generation.
      origin - The origin Location of the structure placement.
      current - The current BlockInfo as modified by previous processors.
      original - The original BlockInfo as saved in the structure file.
      Returns:
      The modified BlockInfo, or null to skip placement.
    • getType

      public abstract StructureProcessorType<?> getType()
      Retrieves the structure processor type associated with this specific implementation. This is primarily used for serialization via the polymorphic codec.
      Returns:
      The StructureProcessorType identifying this processor.