Interface GateAPI

All Known Implementing Classes:
Gate

public interface GateAPI
Acts as an interface between a minecraft world, and a format space. In comparison to Portal this interface has nothing to do with entities and teleportation.
  • Method Details

    • drawControlMechanisms

      void drawControlMechanisms(LineData[] lines)
      Set button and draw sign
    • redrawPosition

      void redrawPosition(PortalPosition portalPosition, @Nullable @Nullable LineData[] lines)
      Update the state on the portal position according to its type
      Parameters:
      portalPosition -

      The portal position to update

    • getPortalPositions

      List<PortalPosition> getPortalPositions()
      Gets a copy of this gate's portal positions
      Returns:

      A copy of this gate's portal positions

    • getLocations

      List<BlockLocation> getLocations(GateStructureType structureType)
      Gets all locations of this gate containing the given structure type
      Parameters:
      structureType -

      The structure type to get locations of

      Returns:

      All locations containing the given structure type

    • open

      void open()
      Opens this gate
    • close

      void close()
      Closes this gate
    • getExit

      org.bukkit.Location getExit()
      Gets the exit location of this gate
      Returns:

      The exit location of this gate

    • isOpen

      boolean isOpen()
      Gets whether this gate is currently open
      Returns:

      Whether this gate is currently open

    • getFormat

      GateFormatAPI getFormat()
      Gets the gate format used by this gate
      Returns:

      The gate format used by this gate

    • getFacing

      org.bukkit.block.BlockFace getFacing()
      Gets the block face defining this gate's direction
      Returns:

      The block face defining this gate's direction

    • getRelativeVector

      org.bukkit.util.Vector getRelativeVector(org.bukkit.Location location)
      Gets a vector relative to this gate's top-left location using the given location
      Parameters:
      location -

      The location to turn into a relative location

      Returns:

      A location relative to this gate's top-left location

    • getFlipZ

      boolean getFlipZ()
      Gets whether this gate has been flipped on the z-axis
      Returns:

      Whether this gate has been flipped on the z-axis

    • getLocation

      org.bukkit.Location getLocation(@NotNull @NotNull org.bukkit.util.Vector vector)
      Gets a location from a relative vector
      Parameters:
      vector -

      The vector defining a location

      Returns:

      The location corresponding to the given vector

    • isValid

      boolean isValid() throws GateConflictException
      Check if this gate with the current settings is valid
      Returns:

      True if this gate is valid

      Throws:
      GateConflictException -

      If this gate conflicts with another gate

    • calculatePortalPositions

      void calculatePortalPositions(boolean alwaysOn) throws InvalidStructureException
      Calculates all portal positions for this gate
      Parameters:
      alwaysOn -

      Whether this gate is always on

      Throws:
      InvalidStructureException
    • getTopLeft

      org.bukkit.Location getTopLeft()
      Gets this gate's top-left location
      Returns:

      This gate's top-left location

    • addPortalPosition

      PortalPosition addPortalPosition(org.bukkit.Location location, PositionType type, String pluginName)
      Add a position specific for this Gate
      Parameters:
      location -

      The location of the position

      type -

      The type of position

      Returns:

      The added portal position

    • addPortalPosition

      void addPortalPosition(PortalPosition portalPosition)
      Add a position specific to this Gate
      Parameters:
      portalPosition -

      The portal position

    • removePortalPosition

      @Nullable @Nullable PortalPosition removePortalPosition(org.bukkit.Location location)
      Remove portal position at specified location
      Parameters:
      location - The location of the portal position to be removed
      Returns:

      The removed portal position

    • removePortalPosition

      @Internal void removePortalPosition(PortalPosition portalPosition)
      Remove a portal position from this gate. Does not remove the portal position in the registry or database. Please use RegistryAPI.removePortalPosition(Location) with conjunction to StorageAPI.removePortalPosition(RealPortal, StorageType, PortalPosition)
      Parameters:
      portalPosition -

      The portal position to remove

    • forceGenerateStructure

      void forceGenerateStructure()
      Modify the world such that the gate follows its gateformat
    • assignPortal

      @Internal void assignPortal(RealPortal realPortal)
      Assign a real portal to this gate
      Parameters:
      realPortal -

      The portal to assign to this gate

    • getPortal

      RealPortal getPortal()
      Get the portal assigned to this portal position
      Returns:

      The portal assigned to this portal position