Class MultiBlockStructure

java.lang.Object
redempt.redlib.multiblock.MultiBlockStructure

public class MultiBlockStructure extends Object
A utility class intended to create interactive multi-block structures. Can also be used to store and copy large sections of blocks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected StructureData[][][]
     
    protected int
     
    protected int
     
    protected int
     
    protected boolean
     
    protected boolean
     
    protected EnumSet<org.bukkit.Material>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addStrictModeExclusions(org.bukkit.Material... materials)
    Add a list of Materials to be excluded from strict data checks rather than disabling strict mode for all blocks
    assumeAt(org.bukkit.Location loc)
    Gets the Structure at the given block, performing no checks to ensure it exists.
    assumeAt(org.bukkit.Location loc, int rotation)
    Gets the Structure at the given block, performing no checks to ensure it exists.
    assumeAt(org.bukkit.Location loc, int rotation, boolean mirror)
    Gets the Structure at the given block, performing no checks to ensure it exists.
    assumeAt(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
    Gets the Structure at the given block, performing no checks to ensure it exists.
    build(org.bukkit.Location loc)
    Builds this multi-block structure at the given location
    build(org.bukkit.Location loc, int rotation)
    Builds this multi-block structure at the given location
    build(org.bukkit.Location loc, int relX, int relY, int relZ)
    Builds this multi-block structure at the given location
    build(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation)
    Builds this multi-block structure at the given location
    build(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
    Builds this multi-block structure at the given location
    int
    buildAsync(org.bukkit.Location loc, int rotation, boolean mirror, int blocksPerTick, Consumer<Structure> callback)
    Build this multi-block structure over multiple ticks
    int
    buildAsync(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, int blocksPerTick, Consumer<Structure> callback)
    Build this multi-block structure over multiple ticks
    int
    buildAsync(org.bukkit.Location loc, int rotation, int blocksPerTick, Consumer<Structure> callback)
    Build this multi-block structure over multiple ticks
    int
    buildAsync(org.bukkit.Location loc, int blocksPerTick, Consumer<Structure> callback)
    Build this multi-block structure over multiple ticks
    boolean
    canBuild(org.bukkit.Location loc, int rotation, boolean mirror, Predicate<org.bukkit.Location> filter)
    Uses a Predicate to test each block where this structure would be built
    boolean
    canBuild(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, Predicate<org.bukkit.Location> filter)
    Uses a Predicate to test each block where this structure would be built
    boolean
    canBuild(org.bukkit.Location loc, int rotation, Predicate<org.bukkit.Location> filter)
    Uses a Predicate to test each block where this structure would be built
    boolean
    canBuild(org.bukkit.Location loc, Predicate<org.bukkit.Location> filter)
    Uses a Predicate to test each block where this structure would be built
    protected boolean
    compare(StructureData data, org.bukkit.block.Block block, Rotator rotator)
     
    create(InputStream stream, String name)
    Creates a MultiBlockStructure instance from an input stream containing the info string
    create(InputStream stream, String name, boolean strictMode)
    Creates a MultiBlockStructure instance from an input stream containing the info string
    create(InputStream stream, String name, boolean strictMode, boolean ignoreAir)
    Creates a MultiBlockStructure instance from an input stream containing the info string
    create(String info, String name)
    Creates a MultiBlockStructure instance from an info string
    create(String info, String name, boolean strictMode)
    Creates a MultiBlockStructure instance from an info string
    create(String info, String name, boolean strictMode, boolean ignoreAir)
    Creates a MultiBlockStructure instance from an info string
    boolean
     
    void
    forEachBlock(org.bukkit.Location loc, int rotation, boolean mirror, Consumer<org.bukkit.block.BlockState> callback)
    Iterates each block which would be set if this structure is built
    void
    forEachBlock(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, Consumer<org.bukkit.block.BlockState> callback)
    Iterates each block which would be set if this structure is built
    void
    forEachBlock(org.bukkit.Location loc, int rotation, Consumer<org.bukkit.block.BlockState> callback)
    Iterates each block which would be set if this structure is built
    void
    forEachBlock(org.bukkit.Location loc, Consumer<org.bukkit.block.BlockState> callback)
    Iterates each block which would be set if this structure is built
    getAt(org.bukkit.Location loc)
    Gets the Structure at the given block, if it exists.
    getAt(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
    Gets the Structure at the given block, if it exists.
    org.bukkit.block.BlockState
    getData(int relX, int relY, int relZ)
    Gets the data of this structure at a given relative location
    org.bukkit.block.BlockState
    getData(org.bukkit.Location loc, int relX, int relY, int relZ)
    Gets the data of this structure at a given relative location, set with a BlockState at the given location
    int[]
    Gets the dimensions of this multi-block structure.
    Gets this multi-block structure's name.
    getRegion(org.bukkit.Location loc)
    Gets the Region this multi-block structure would occupy, were it built here
    getRegion(org.bukkit.Location loc, int rotation)
    Gets the Region this multi-block structure would occupy, were it built here
    getRegion(org.bukkit.Location loc, int rotation, boolean mirror)
    Gets the Region this multi-block structure would occupy, were it built here
    getRegion(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
    Gets the Region this multi-block structure would occupy, were it built here
    Set<org.bukkit.Material>
     
    getStructureData(int relX, int relY, int relZ)
    Gets the StructureData at a certain relative position
    org.bukkit.Material
    getType(int relX, int relY, int relZ)
    Gets the Material at a certain relative position
    int
     
    int
     
    boolean
     
    boolean
     
    static String
    stringify(org.bukkit.Location start, org.bukkit.Location end)
    Use this to get the info to construct a multi-block structure.
    static String
    stringify(org.bukkit.Location start, org.bukkit.Location end, org.bukkit.Material skip)
    Use this to get the info to construct a multi-block structure.
     
    void
    visualize(org.bukkit.entity.Player player, org.bukkit.Location loc, int relX, int relY, int relZ)
    Sends ghost blocks of this multi-block structure to the given player at the given location
    void
    visualize(org.bukkit.entity.Player player, org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
    Sends ghost blocks of this multi-block structure to the given player at the given location

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • data

      protected StructureData[][][] data
    • dimX

      protected int dimX
    • dimY

      protected int dimY
    • dimZ

      protected int dimZ
    • strictMode

      protected boolean strictMode
    • ignoreAir

      protected boolean ignoreAir
    • strictModeExclude

      protected EnumSet<org.bukkit.Material> strictModeExclude
  • Method Details

    • stringify

      public static String stringify(org.bukkit.Location start, org.bukkit.Location end, org.bukkit.Material skip)
      Use this to get the info to construct a multi-block structure. Should be hard-coded. You can use the multi-block structure tool (/struct wand) as long as devMode is true
      Parameters:
      start - One bounding corner of the region
      end - The other bounding corner of the region
      skip - A block type to be skipped, in case it was used to select the corners
      Returns:
      A string representing all of the block data for the region
      Throws:
      IllegalArgumentException - if the specified locations are not in the same world
    • stringify

      public static String stringify(org.bukkit.Location start, org.bukkit.Location end)
      Use this to get the info to construct a multi-block structure. Should be hard-coded. You can use the multi-block structure tool (/struct wand) as long as devMode is true
      Parameters:
      start - One bounding corner of the region
      end - The other bounding corner of the region
      Returns:
      A string representing all of the block data for the region
      Throws:
      IllegalArgumentException - if the specified locations are not in the same world
    • create

      public static MultiBlockStructure create(String info, String name)
      Creates a MultiBlockStructure instance from an info string
      Parameters:
      info - The info string. Get this from stringify(Location, Location)
      name - The name of the multi-block structure
      Returns:
      The multi-block structure
    • create

      public static MultiBlockStructure create(String info, String name, boolean strictMode)
      Creates a MultiBlockStructure instance from an info string
      Parameters:
      info - The info string. Get this from stringify(Location, Location)
      name - The name of the multi-block structure
      strictMode - Whether block data is taken into account. Only checks material if false. Defaults to true.
      Returns:
      The multi-block structure
    • create

      public static MultiBlockStructure create(String info, String name, boolean strictMode, boolean ignoreAir)
      Creates a MultiBlockStructure instance from an info string
      Parameters:
      info - The info string. Get this from stringify(Location, Location)
      name - The name of the multi-block structure
      strictMode - Whether block data is taken into account. Only checks material if false. Defaults to true.
      ignoreAir - If true, air in the original structure is skipped when checking blocks. Defaults to false.
      Returns:
      The multi-block structure
    • create

      public static MultiBlockStructure create(InputStream stream, String name, boolean strictMode, boolean ignoreAir)
      Creates a MultiBlockStructure instance from an input stream containing the info string
      Parameters:
      stream - The input stream. Get this from JavaPlugin.getResource(String)
      name - The name of the multi-block structure
      strictMode - Whether block data is taken into account. Only checks material if false. Defaults to true.
      ignoreAir - If true, air in the original structure is skipped when checking blocks. Defaults to false.
      Returns:
      The multi-block structure
    • create

      public static MultiBlockStructure create(InputStream stream, String name, boolean strictMode)
      Creates a MultiBlockStructure instance from an input stream containing the info string
      Parameters:
      stream - The input stream. Get this from JavaPlugin.getResource(String)
      name - The name of the multi-block structure
      strictMode - Whether block data is taken into account. Only checks material if false. Defaults to true.
      Returns:
      The multi-block structure
    • create

      public static MultiBlockStructure create(InputStream stream, String name)
      Creates a MultiBlockStructure instance from an input stream containing the info string
      Parameters:
      stream - The input stream. Get this from JavaPlugin.getResource(String)
      name - The name of the multi-block structure
      Returns:
      The multi-block structure
    • addStrictModeExclusions

      public void addStrictModeExclusions(org.bukkit.Material... materials)
      Add a list of Materials to be excluded from strict data checks rather than disabling strict mode for all blocks
      Parameters:
      materials - The materials to exclude from strict mode checks
    • getStrictModeExclusions

      public Set<org.bukkit.Material> getStrictModeExclusions()
      Returns:
      A set of Materials to be excluded from strict data checks rather than disabling strict mode for all blocks
    • getRegion

      public CuboidRegion getRegion(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
      Gets the Region this multi-block structure would occupy, were it built here
      Parameters:
      loc - The location of the multi-block structure
      relX - The relative X in the structure to center at
      relY - The relative Y in the structure to center at
      relZ - The relative Z in the structure to center at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      Returns:
      The Region this multi-block structure would occupy
    • getRegion

      public CuboidRegion getRegion(org.bukkit.Location loc, int rotation, boolean mirror)
      Gets the Region this multi-block structure would occupy, were it built here
      Parameters:
      loc - The location of the multi-block structure
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      Returns:
      The Region this multi-block structure would occupy
    • getRegion

      public CuboidRegion getRegion(org.bukkit.Location loc, int rotation)
      Gets the Region this multi-block structure would occupy, were it built here
      Parameters:
      loc - The location of the multi-block structure
      rotation - The number of 90-degree clockwise rotations to apply
      Returns:
      The Region this multi-block structure would occupy
    • getRegion

      public CuboidRegion getRegion(org.bukkit.Location loc)
      Gets the Region this multi-block structure would occupy, were it built here
      Parameters:
      loc - The location of the multi-block structure
      Returns:
      The Region this multi-block structure would occupy
    • forEachBlock

      public void forEachBlock(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, Consumer<org.bukkit.block.BlockState> callback)
      Iterates each block which would be set if this structure is built
      Parameters:
      loc - The location the structure would be built at
      relX - The relative X in the structure to center at
      relY - The relative Y in the structure to center at
      relZ - The relative Z in the structure to center at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      callback - The callback to be called, passed the BlockState which would be set if the structure is built here
    • getData

      public org.bukkit.block.BlockState getData(org.bukkit.Location loc, int relX, int relY, int relZ)
      Gets the data of this structure at a given relative location, set with a BlockState at the given location
      Parameters:
      loc - The location to use for the BlockState
      relX - The relative X of the block within this multi-block structure
      relY - The relative Y of the block within this multi-block structure
      relZ - The relative Z of the block within this multi-block structure
      Returns:
      A BlockState, with the Location passed, with the data at the specified relative location within this multi-block structure. This is done for compatibility reasons. For 1.8, MaterialData would make the most sense, while for 1.13+, BlockData would. BlockState can be converted to either.
      Throws:
      ArrayIndexOutOfBoundsException - if the relative coordinates do not exist within this structure
    • getData

      public org.bukkit.block.BlockState getData(int relX, int relY, int relZ)
      Gets the data of this structure at a given relative location
      Parameters:
      relX - The relative X of the block within this multi-block structure
      relY - The relative Y of the block within this multi-block structure
      relZ - The relative Z of the block within this multi-block structure
      Returns:
      A BlockState, with the Location (0, 0, 0) in the default world, with the data at the specified relative location within this multi-block structure. This is done for compatibility reasons. For 1.8, MaterialData would make the most sense, while for 1.13+, BlockData would. BlockState can be converted to either.
      Throws:
      ArrayIndexOutOfBoundsException - if the relative coordinates do not exist within this structure
    • getStructureData

      public StructureData getStructureData(int relX, int relY, int relZ)
      Gets the StructureData at a certain relative position
      Parameters:
      relX - The relative X of the block within this multi-block structure
      relY - The relative Y of the block within this multi-block structure
      relZ - The relative Z of the block within this multi-block structure
      Returns:
      StructureData for the given relative position
      Throws:
      ArrayIndexOutOfBoundsException - if the relative coordinates are out of bounds
    • getType

      public org.bukkit.Material getType(int relX, int relY, int relZ)
      Gets the Material at a certain relative position
      Parameters:
      relX - The relative X of the block within this multi-block structure
      relY - The relative Y of the block within this multi-block structure
      relZ - The relative Z of the block within this multi-block structure
      Returns:
      Material for the given relative position
      Throws:
      ArrayIndexOutOfBoundsException - if the relative coordinates are out of bounds
    • forEachBlock

      public void forEachBlock(org.bukkit.Location loc, int rotation, boolean mirror, Consumer<org.bukkit.block.BlockState> callback)
      Iterates each block which would be set if this structure is built
      Parameters:
      loc - The location the structure would be built at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      callback - The callback to be called, passed the BlockState which would be set if the structure is built here
    • forEachBlock

      public void forEachBlock(org.bukkit.Location loc, int rotation, Consumer<org.bukkit.block.BlockState> callback)
      Iterates each block which would be set if this structure is built
      Parameters:
      loc - The location the structure would be built at
      rotation - The number of 90-degree clockwise rotations to apply
      callback - The callback to be called, passed the BlockState which would be set if the structure is built here
    • forEachBlock

      public void forEachBlock(org.bukkit.Location loc, Consumer<org.bukkit.block.BlockState> callback)
      Iterates each block which would be set if this structure is built
      Parameters:
      loc - The location the structure would be built at
      callback - The callback to be called, passed the BlockState which would be set if the structure is built here
    • canBuild

      public boolean canBuild(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, Predicate<org.bukkit.Location> filter)
      Uses a Predicate to test each block where this structure would be built
      Parameters:
      loc - The location to test the conditions at
      relX - The relative X in the structure to test centered at
      relY - The relative Y in the structure to test centered at
      relZ - The relative Z in the structure to test centered at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      filter - The predicate to check each location
      Returns:
      Whether every location passed the check
    • canBuild

      public boolean canBuild(org.bukkit.Location loc, int rotation, boolean mirror, Predicate<org.bukkit.Location> filter)
      Uses a Predicate to test each block where this structure would be built
      Parameters:
      loc - The location to test the conditions at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      filter - The predicate to check each location
      Returns:
      Whether every location passed the check
    • canBuild

      public boolean canBuild(org.bukkit.Location loc, int rotation, Predicate<org.bukkit.Location> filter)
      Uses a Predicate to test each block where this structure would be built
      Parameters:
      loc - The location to test the conditions at
      rotation - The number of 90-degree clockwise rotations to apply
      filter - The predicate to check each location
      Returns:
      Whether every location passed the check
    • canBuild

      public boolean canBuild(org.bukkit.Location loc, Predicate<org.bukkit.Location> filter)
      Uses a Predicate to test each block where this structure would be built
      Parameters:
      loc - The location to test the conditions at
      filter - The predicate to check each location
      Returns:
      Whether every location passed the check
    • visualize

      public void visualize(org.bukkit.entity.Player player, org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
      Sends ghost blocks of this multi-block structure to the given player at the given location
      Parameters:
      player - The player to visualize the structure to
      loc - The location to visualize the structure at
      relX - The relative X in the structure to visualize centered at
      relY - The relative Y in the structure to visualize centered at
      relZ - The relative Z in the structure to visualize centered at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
    • visualize

      public void visualize(org.bukkit.entity.Player player, org.bukkit.Location loc, int relX, int relY, int relZ)
      Sends ghost blocks of this multi-block structure to the given player at the given location
      Parameters:
      player - The player to visualize the structure to
      loc - The location to visualize the structure at
      relX - The relative X in the structure to visualize centered at
      relY - The relative Y in the structure to visualize centered at
      relZ - The relative Z in the structure to visualize centered at
    • build

      public Structure build(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
      Builds this multi-block structure at the given location
      Parameters:
      loc - The location to build the structure at
      relX - The relative X in the structure to build centered at
      relY - The relative Y in the structure to build centered at
      relZ - The relative Z in the structure to build centered at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      Returns:
      The Structure instance that was created
    • build

      public Structure build(org.bukkit.Location loc, int relX, int relY, int relZ)
      Builds this multi-block structure at the given location
      Parameters:
      loc - The location to build the structure at
      relX - The relative X in the structure to build centered at
      relY - The relative Y in the structure to build centered at
      relZ - The relative Z in the structure to build centered at
      Returns:
      The Structure instance that was created
    • build

      public Structure build(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation)
      Builds this multi-block structure at the given location
      Parameters:
      loc - The location to build the structure at
      relX - The relative X in the structure to build centered at
      relY - The relative Y in the structure to build centered at
      relZ - The relative Z in the structure to build centered at
      rotation - The number of 90-degree clockwise rotations to apply
      Returns:
      The Structure instance that was created
    • build

      public Structure build(org.bukkit.Location loc)
      Builds this multi-block structure at the given location
      Parameters:
      loc - The location to build the structure at
      Returns:
      The Structure instance that was created
    • build

      public Structure build(org.bukkit.Location loc, int rotation)
      Builds this multi-block structure at the given location
      Parameters:
      loc - The location to build the structure at
      rotation - The number of 90-degree clockwise rotations to apply
      Returns:
      The Structure instance that was created
    • buildAsync

      public int buildAsync(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror, int blocksPerTick, Consumer<Structure> callback)
      Build this multi-block structure over multiple ticks
      Parameters:
      loc - The location to build the structure at
      relX - The relative X in the structure to build centered at
      relY - The relative Y in the structure to build centered at
      relZ - The relative Z in the structure to build centered at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      blocksPerTick - The number of blocks to build per tick
      callback - A callback to accept the Structure instance that was created when construction is complete
      Returns:
      The task number for the Bukkit scheduler task created by this method
    • buildAsync

      public int buildAsync(org.bukkit.Location loc, int rotation, boolean mirror, int blocksPerTick, Consumer<Structure> callback)
      Build this multi-block structure over multiple ticks
      Parameters:
      loc - The location to build the structure at
      rotation - The number of 90-degree clockwise rotations to apply
      mirror - Whether to mirror the structure on the X axis
      blocksPerTick - The number of blocks to build per tick
      callback - A callback to accept the Structure instance that was created when construction is complete
      Returns:
      The task number for the Bukkit scheduler task created by this method
    • buildAsync

      public int buildAsync(org.bukkit.Location loc, int rotation, int blocksPerTick, Consumer<Structure> callback)
      Build this multi-block structure over multiple ticks
      Parameters:
      loc - The location to build the structure at
      rotation - The number of 90-degree clockwise rotations to apply
      blocksPerTick - The number of blocks to build per tick
      callback - A callback to accept the Structure instance that was created when construction is complete
      Returns:
      The task number for the Bukkit scheduler task created by this method
    • buildAsync

      public int buildAsync(org.bukkit.Location loc, int blocksPerTick, Consumer<Structure> callback)
      Build this multi-block structure over multiple ticks
      Parameters:
      loc - The location to build the structure at
      blocksPerTick - The number of blocks to build per tick
      callback - A callback to accept the Structure instance that was created when construction is complete
      Returns:
      The task number for the Bukkit scheduler task created by this method
    • getName

      public String getName()
      Gets this multi-block structure's name. May be faster to compare this than to use .equals().
      Returns:
      The name of this multi-block structure
    • getDimensions

      public int[] getDimensions()
      Gets the dimensions of this multi-block structure. [x, y, z]
      Returns:
      The dimensions of this multi-block structure
    • getVolume

      public int getVolume()
      Returns:
      The volume of this multi-block structure in blocks
    • ignoresAir

      public boolean ignoresAir()
      Returns:
      Whether this structure ignores air in the data when building and checking for presence
    • isStrictMode

      public boolean isStrictMode()
      Returns:
      Whether this structure ignores data other than block type when checking for presence
    • getAt

      public Structure getAt(org.bukkit.Location loc)
      Gets the Structure at the given block, if it exists. The given location can be any part of the multi-block structure. This is very computationally expensive for larger structures, and should be avoided if possible, as it checks every possible rotation and mirroring of the structure.
      Parameters:
      loc - The location to check at
      Returns:
      The structure at this block, or null if it does not exist
    • getAt

      public Structure getAt(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
      Gets the Structure at the given block, if it exists. All parameters must be known. Significantly faster than getAt(Location)
      Parameters:
      loc - The location to check at
      relX - The relative X in the structure of the location
      relY - The relative Y in the structure of the location
      relZ - The relative Z in the structure of the location
      rotation - The number of clockwise rotations applied to the structure
      mirror - Whether the structure is mirrored
      Returns:
      The structure at this block, or null if it does not exist
    • assumeAt

      public Structure assumeAt(org.bukkit.Location loc, int relX, int relY, int relZ, int rotation, boolean mirror)
      Gets the Structure at the given block, performing no checks to ensure it exists.
      Parameters:
      loc - The location of the Structure
      relX - The relative X of the location within the Structure
      relY - The relative Y of the location within the Structure
      relZ - The relative Z of the location within the Structure
      rotation - The number of clockwise rotations applied to the structure
      mirror - Whether the structure is mirrored
      Returns:
      The Structure instance
    • assumeAt

      public Structure assumeAt(org.bukkit.Location loc, int rotation, boolean mirror)
      Gets the Structure at the given block, performing no checks to ensure it exists.
      Parameters:
      loc - The location of the Structure
      rotation - The number of clockwise rotations applied to the structure
      mirror - Whether the structure is mirrored
      Returns:
      The Structure instance
    • assumeAt

      public Structure assumeAt(org.bukkit.Location loc, int rotation)
      Gets the Structure at the given block, performing no checks to ensure it exists.
      Parameters:
      loc - The location of the Structure
      rotation - The number of clockwise rotations applied to the structure
      Returns:
      The Structure instance
    • assumeAt

      public Structure assumeAt(org.bukkit.Location loc)
      Gets the Structure at the given block, performing no checks to ensure it exists.
      Parameters:
      loc - The location of the Structure
      Returns:
      The Structure instance
    • compare

      protected boolean compare(StructureData data, org.bukkit.block.Block block, Rotator rotator)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object