Class Structure

java.lang.Object
com.github.darksoulq.abyssallib.world.structure.Structure

public class Structure extends Object
Represents a fully captured, transformable, and replayable structure definition. This implementation supports palette-based block storage for deduplication, relative positioning for blocks and entities, transformation via rotations and mirrors, and both synchronous and asynchronous placement routines.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A lightweight data record describing a unique combination of block type and properties.
    static final record 
    A structural marker indicating the position and index configuration of a discrete block.
    static final record 
    A structural marker holding a serialized entity and its exact relative spatial location.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Codec<Structure>
     
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Structure(org.bukkit.util.Vector size, List<Structure.PaletteEntry> palette, List<Structure.StructureBlock> blocks, List<Structure.StructureEntity> entities)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends a StructureProcessor to the placement pipeline.
    void
    fill(@NotNull org.bukkit.Location corner1, @NotNull org.bukkit.Location corner2, @NotNull org.bukkit.Location origin)
    Captures all blocks within the defined region, excluding entities.
    void
    fill(@NotNull org.bukkit.Location corner1, @NotNull org.bukkit.Location corner2, @NotNull org.bukkit.Location origin, boolean includeEntities)
    Captures blocks and optionally entities within the defined physical region.
    void
    place(@NotNull WorldGenAccess level, @NotNull org.bukkit.Location origin, @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull org.bukkit.block.structure.Mirror mirror, float integrity)
    Places this structure inside an asynchronous or virtual WorldGenAccess context.
    void
    place(@NotNull org.bukkit.Location origin, @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull org.bukkit.block.structure.Mirror mirror, float integrity)
    Places this structure synchronously targeting regional thread execution requirements seamlessly.
    placeAsync(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.Location origin, @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull org.bukkit.block.structure.Mirror mirror, float integrity, int blocksPerTick)
    Places this structure asynchronously using a scheduled repeating task securely evaluating regional boundaries.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • fill

      public void fill(@NotNull @NotNull org.bukkit.Location corner1, @NotNull @NotNull org.bukkit.Location corner2, @NotNull @NotNull org.bukkit.Location origin)
      Captures all blocks within the defined region, excluding entities.
      Parameters:
      corner1 - The first corner Location bounding the region.
      corner2 - The opposite corner Location bounding the region.
      origin - The designated origin Location utilized for relative positioning.
    • fill

      public void fill(@NotNull @NotNull org.bukkit.Location corner1, @NotNull @NotNull org.bukkit.Location corner2, @NotNull @NotNull org.bukkit.Location origin, boolean includeEntities)
      Captures blocks and optionally entities within the defined physical region. Regional processor dynamically executes chunk-safe block mapping on Folia or Bukkit.
      Parameters:
      corner1 - The first corner Location bounding the region.
      corner2 - The opposite corner Location bounding the region.
      origin - The origin Location used for zero-point relative alignment.
      includeEntities - True if entities within the bounding box should be captured and serialized.
    • placeAsync

      public CompletableFuture<Void> placeAsync(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.Location origin, @NotNull @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull @NotNull org.bukkit.block.structure.Mirror mirror, float integrity, int blocksPerTick)
      Places this structure asynchronously using a scheduled repeating task securely evaluating regional boundaries.
      Parameters:
      plugin - The Plugin utilized for scheduling the task.
      origin - The target placement origin Location.
      rotation - The StructureRotation to apply.
      mirror - The Mirror transformation to apply.
      integrity - The survival chance [0.0 - 1.0] for each individual block.
      blocksPerTick - The maximum number of blocks to process per execution slice.
      Returns:
      A CompletableFuture that resolves when the entire placement operation completes.
    • place

      public void place(@NotNull @NotNull org.bukkit.Location origin, @NotNull @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull @NotNull org.bukkit.block.structure.Mirror mirror, float integrity)
      Places this structure synchronously targeting regional thread execution requirements seamlessly.
      Parameters:
      origin - The target placement origin Location.
      rotation - The StructureRotation to apply.
      mirror - The Mirror transformation to apply.
      integrity - The survival chance [0.0 - 1.0] for each individual block.
    • place

      public void place(@NotNull @NotNull WorldGenAccess level, @NotNull @NotNull org.bukkit.Location origin, @NotNull @NotNull org.bukkit.block.structure.StructureRotation rotation, @NotNull @NotNull org.bukkit.block.structure.Mirror mirror, float integrity)
      Places this structure inside an asynchronous or virtual WorldGenAccess context. Handles deferring out-of-bounds placements back to regional scheduled executions explicitly ensuring safe completion.
      Parameters:
      level - The WorldGenAccess bridging chunk generation.
      origin - The target placement origin Location.
      rotation - The StructureRotation to apply.
      mirror - The Mirror transformation to apply.
      integrity - The survival chance [0.0 - 1.0] for each individual block.
    • addProcessor

      public void addProcessor(StructureProcessor processor)
      Appends a StructureProcessor to the placement pipeline.
      Parameters:
      processor - The StructureProcessor to add.