Class GateStructure

java.lang.Object
org.sgrewritten.stargate.api.gate.structure.GateStructure
Direct Known Subclasses:
GateControlBlock, GateFrame, GateIris

public abstract class GateStructure extends Object
Represents one of the structures used in a gate
  • Constructor Details

    • GateStructure

      public GateStructure()
  • Method Details

    • isValidState

      public boolean isValidState(VectorOperation vectorOperation, org.bukkit.Location topLeft)
      Checks if all the blocks part of this structure matches a built structure

      Goes through every part of the structure, finds the hypothetical location of this part by doing a vector operation. Checks if that position is allowed to have the material it has.

      Parameters:
      vectorOperation -

      The vector operation to use for rotating the structure

      topLeft -

      The location of the built portal's top-left block

      Returns:
      true if all parts had valid materials
    • getStructureTypePositions

      public abstract List<org.bukkit.util.BlockVector> getStructureTypePositions()
      Gets all positions, represented by block vectors, where this structure type is used
      Returns:

      All positions where this structure type is used

    • isValidBlock

      protected abstract boolean isValidBlock(org.bukkit.util.BlockVector blockVector, org.bukkit.Material material)
      Checks if a block in the built portal matches the block in this structure
      Parameters:
      blockVector -

      The position of the block to check

      material -

      The material found in the built portal

      Returns:

      True if the material matches

    • generateStructure

      public abstract void generateStructure(VectorOperation converter, org.bukkit.Location topLeft)
      Generate the structure from format
      Parameters:
      converter -

      Conversion between real space and format space

      topLeft -

      Top left corner in real space

    • getBoundingBox

      public abstract org.bukkit.util.BoundingBox getBoundingBox()
      Returns:

      The smallest box wherein this gate fits