Class GateFormat

java.lang.Object
org.sgrewritten.stargate.gate.GateFormat
All Implemented Interfaces:
GateFormatAPI

public class GateFormat extends Object implements GateFormatAPI
A representation of a gate's format, including all its structures
  • Constructor Details

    • GateFormat

      public GateFormat(GateIris iris, GateFrame frame, GateControlBlock controlBlocks, String name, boolean isIronDoorBlockable, Set<org.bukkit.Material> controlMaterials)
      Instantiates a new gate format
      Parameters:
      iris -

      The format's iris structure

      frame -

      The format's frame structure

      controlBlocks -

      The format's control block structure

      name -

      The name of the new gate format

      isIronDoorBlockable -

      Whether the gate format's iris can be blocked by a single iron door

      controlMaterials - The materials to use for this gates control blocks
  • Method Details

    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface GateFormatAPI
      Returns:

      the height of the format (Y axis)

    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface GateFormatAPI
      Returns:

      The width of the format (Z axis)

    • getBoundingBox

      public org.bukkit.util.BoundingBox getBoundingBox()
      Description copied from interface: GateFormatAPI
      Get the bounding box of this gate format
      Specified by:
      getBoundingBox in interface GateFormatAPI
      Returns:

      The bounding box of this format

    • isIronDoorBlockable

      public boolean isIronDoorBlockable()
      Description copied from interface: GateFormatAPI
      Gets whether this gate format is iron door blockable

      Iron door block-ability is defined as such: Can the Stargate's entrance be fully blocked by a single iron door?

      Specified by:
      isIronDoorBlockable in interface GateFormatAPI
      Returns:

      True if iron door blockable

    • matches

      public boolean matches(VectorOperation converter, org.bukkit.Location topLeft)
      Checks if the structure of a physical stargate matches this one
      Specified by:
      matches in interface GateFormatAPI
      Parameters:
      converter -

      topLeft -

      The top-left location of the physical stargate to match

      Returns:

      True if the stargate matches this format

    • getControlBlocks

      public List<org.bukkit.util.BlockVector> getControlBlocks()
      Gets the locations of this gate format's control blocks
      Specified by:
      getControlBlocks in interface GateFormatAPI
      Returns:

      The locations of this gate format's control blocks

    • getIrisMaterial

      public org.bukkit.Material getIrisMaterial(boolean getOpenMaterial)
      Description copied from interface: GateFormatAPI
      Gets the material used for this gate format's iris when in the given state
      Specified by:
      getIrisMaterial in interface GateFormatAPI
      Parameters:
      getOpenMaterial -

      Whether to get the open-material or the closed-material

      Returns:

      The material used for this gate format's iris

    • getExit

      public org.bukkit.util.BlockVector getExit()
      Gets this gate format's exit block
      Specified by:
      getExit in interface GateFormatAPI
      Returns:

      This gate format's exit block

    • getFileName

      public String getFileName()
      Specified by:
      getFileName in interface GateFormatAPI
      Returns:

      The name of the file this format was loaded from

    • getControlMaterials

      public Set<org.bukkit.Material> getControlMaterials()
      Returns:

      The set of materials that this format can have a control on

    • getStructure

      public GateStructure getStructure(GateFormatStructureType type)
      Get the GateStructure of the specified type
      Specified by:
      getStructure in interface GateFormatAPI
      Parameters:
      type -

      The specified type of GateStructure

      Returns:

      The GateStructure of the specified type