Class GateIris

java.lang.Object
org.sgrewritten.stargate.api.gate.structure.GateStructure
org.sgrewritten.stargate.gate.structure.GateIris

public class GateIris extends GateStructure
Represents the iris (opening) part of the gate structure
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final List<org.bukkit.util.BlockVector>
     
    final Set<org.bukkit.Material>
     
    final Set<org.bukkit.Material>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GateIris(Set<org.bukkit.Material> irisOpen, Set<org.bukkit.Material> irisClosed)
    Instantiates a new gate iris
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addExit(org.bukkit.util.BlockVector exitPoint)
    Adds an exit point to this iris
    void
    addPart(org.bukkit.util.BlockVector blockVector)
    Adds a block to the blocks which are part of this iris
    void
    generateStructure(VectorOperation converter, org.bukkit.Location topLeft)
    Generate the structure from format
    org.bukkit.util.BoundingBox
     
    org.bukkit.util.BlockVector
    Gets the exit location of this iris
    org.bukkit.Material
    getMaterial(boolean isOpen)
    Gets one of the materials used for this iris
    List<org.bukkit.util.BlockVector>
    Gets all positions, represented by block vectors, where this structure type is used
    protected 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

    Methods inherited from class org.sgrewritten.stargate.api.gate.structure.GateStructure

    isValidState

    Methods inherited from class java.lang.Object

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

    • irisOpen

      public final Set<org.bukkit.Material> irisOpen
    • irisClosed

      public final Set<org.bukkit.Material> irisClosed
    • blocks

      protected final List<org.bukkit.util.BlockVector> blocks
  • Constructor Details

    • GateIris

      public GateIris(Set<org.bukkit.Material> irisOpen, Set<org.bukkit.Material> irisClosed)
      Instantiates a new gate iris
      Parameters:
      irisOpen -

      The set of materials usable for an open iris

      irisClosed -

      The set of materials usable for a closed iris

  • Method Details

    • addPart

      public void addPart(org.bukkit.util.BlockVector blockVector)
      Adds a block to the blocks which are part of this iris
      Parameters:
      blockVector -

      A block vector describing the location of a block

    • addExit

      public void addExit(org.bukkit.util.BlockVector exitPoint)
      Adds an exit point to this iris
      Parameters:
      exitPoint -

      The point at which players should exit from the iris

    • getStructureTypePositions

      public List<org.bukkit.util.BlockVector> getStructureTypePositions()
      Description copied from class: GateStructure
      Gets all positions, represented by block vectors, where this structure type is used
      Specified by:
      getStructureTypePositions in class GateStructure
      Returns:

      All positions where this structure type is used

    • isValidBlock

      protected boolean isValidBlock(org.bukkit.util.BlockVector blockVector, org.bukkit.Material material)
      Description copied from class: GateStructure
      Checks if a block in the built portal matches the block in this structure
      Specified by:
      isValidBlock in class GateStructure
      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 void generateStructure(VectorOperation converter, org.bukkit.Location topLeft)
      Description copied from class: GateStructure
      Generate the structure from format
      Specified by:
      generateStructure in class GateStructure
      Parameters:
      converter -

      Conversion between real space and format space

      topLeft -

      Top left corner in real space

    • getBoundingBox

      public org.bukkit.util.BoundingBox getBoundingBox()
      Specified by:
      getBoundingBox in class GateStructure
      Returns:

      The smallest box wherein this gate fits

    • getMaterial

      public org.bukkit.Material getMaterial(boolean isOpen)
      Gets one of the materials used for this iris
      Parameters:
      isOpen -

      Whether to get an open-material or a closed-material

      Returns:

      One of the usable materials

    • getExit

      public org.bukkit.util.BlockVector getExit()
      Gets the exit location of this iris
      Returns:

      The exit location of this iris