All Known Subinterfaces:
RealPortal
All Known Implementing Classes:
LegacyVirtualPortal, StargatePortal, VirtualPortal

public interface Portal
An interface describing any portal
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a flag from this portal (does not do so to storage)
    void
    close(boolean forceClose)
    Closes this portal
    void
    The method used when destroying a portal
    Gets all of this portal's portal flags in the form of a string
    Gets the globally unique identifier for this portal
    Gets the unique identifier for this portal
    Gets the name of this portal
    Gets the network this portal belongs to
    Gets the UUID of this portal's owner
    Gets how the portal is stored
    boolean
    Checks whether this portal has the given portal flag enabled
    boolean
     
    boolean
    Checks whether this portal is currently open
    boolean
    isOpenFor(org.bukkit.entity.Entity target)
    Checks whether this portal is currently open and the given target is the one the portal opened for
    void
    open(org.bukkit.entity.Player player)
    Opens this portal for the given player
    void
    Forces this portal to temporarily go to the given destination regardless of the normal destination(s)
    void
    Remove a flag from this portal (does not do so from storage)
    void
    setName(String newName)
    Changes the name of the portal.
    void
    setNetwork(Network targetNetwork)
    Changes the network this portal belongs to
    void
    setOwner(UUID targetPlayer)
    Changes the player this portal belongs to
    void
    teleportHere(org.bukkit.entity.Entity target, RealPortal origin)
    Teleports an entity to this portal
    void
    Looks into available portals to connect to, and updates appearance and behaviour accordingly
  • Method Details

    • destroy

      @Internal void destroy()
      The method used when destroying a portal

      Mainly clears the sign, see NetworkManager.destroyPortal(RealPortal) to really destroy a portal

    • isOpen

      boolean isOpen()
      Checks whether this portal is currently open
      Returns:

      True if this portal is currently open

    • isOpenFor

      boolean isOpenFor(org.bukkit.entity.Entity target)
      Checks whether this portal is currently open and the given target is the one the portal opened for
      Parameters:
      target -

      The target to check

      Returns:

      True if the portal has been opened for the given target

    • teleportHere

      void teleportHere(org.bukkit.entity.Entity target, RealPortal origin)
      Teleports an entity to this portal
      Parameters:
      target -

      The target entity to teleport

      origin -

      The origin portal the entity is teleporting from

    • close

      void close(boolean forceClose)
      Closes this portal
      Parameters:
      forceClose -

      Whether to force this portal to close, even if set to always on or similar

    • open

      void open(org.bukkit.entity.Player player)
      Opens this portal for the given player
      Parameters:
      player -

      The player to open this portal for

    • getName

      String getName()
      Gets the name of this portal
      Returns:

      The name of this portal

    • overrideDestination

      void overrideDestination(Portal destination)
      Forces this portal to temporarily go to the given destination regardless of the normal destination(s)
      Parameters:
      destination -

      The destination this portal should temporarily connect ot

    • getNetwork

      Network getNetwork()
      Gets the network this portal belongs to
      Returns:

      The network this portal belongs to

    • setNetwork

      void setNetwork(Network targetNetwork) throws NameConflictException
      Changes the network this portal belongs to
      Parameters:
      targetNetwork -

      The new network this portal should belong to

      Throws:
      NameConflictException -

      If the given network name is invalid

    • setOwner

      void setOwner(UUID targetPlayer)
      Changes the player this portal belongs to

      DOES NOT SAVE TO DATABASE

      Parameters:
      targetPlayer -

      The new player this portal should belong to

    • hasFlag

      boolean hasFlag(PortalFlag flag)
      Checks whether this portal has the given portal flag enabled
      Parameters:
      flag -

      The portal flag to check for

      Returns:

      True if this portal has the given portal flag enabled

    • removeFlag

      void removeFlag(PortalFlag flag)
      Remove a flag from this portal (does not do so from storage)
      Parameters:
      flag -

      Flag to remove

    • addFlag

      void addFlag(PortalFlag flag)
      Add a flag from this portal (does not do so to storage)
      Parameters:
      flag -

      Flag to add

    • getAllFlagsString

      String getAllFlagsString()
      Gets all of this portal's portal flags in the form of a string

      This returns the concatenation of all character representations for the flags used by this portal.

      Returns:

      All of this portal's portal flags in the form of a string

    • getOwnerUUID

      UUID getOwnerUUID()
      Gets the UUID of this portal's owner

      A portal's owner is the player that created the portal.

      Returns:

      The UUID of this portal's owner

    • updateState

      void updateState()
      Looks into available portals to connect to, and updates appearance and behaviour accordingly
    • getId

      String getId()
      Gets the unique identifier for this portal
      Returns:

      The unique identifier for this portal

    • getGlobalId

      GlobalPortalId getGlobalId()
      Gets the globally unique identifier for this portal
      Returns:

      The globally unique identifier for this portal

    • getStorageType

      StorageType getStorageType()
      Gets how the portal is stored
      Returns:

      The storage type of the portal

    • setName

      @Internal void setName(String newName)
      Changes the name of the portal. Use NetworkManager.rename(Portal, String) instead, as this does not save to database, nor update its name to the portal network.
      Parameters:
      newName -

      The new name of the portal

    • isDestroyed

      boolean isDestroyed()
      Returns:

      True if this portal has been destroyed