Interface RealPortal

All Superinterfaces:
MetadataHolder, Portal
All Known Implementing Classes:
StargatePortal

public interface RealPortal extends Portal, MetadataHolder
A real portal with a physical sign that is located on this server
  • Method Details

    • open

      void open(@Nullable @Nullable Portal destination, @Nullable @Nullable org.bukkit.entity.Player actor)
      Open this portal without any checks
      Parameters:
      destination -

      The destination to open to

      actor -

      The player which opened this portal

    • setSignColor

      void setSignColor(org.bukkit.DyeColor color, PortalPosition portalPosition)
      Updates the color of this portal's sign

      Replacement function for Sign.setColor(org.bukkit.DyeColor), as the portal sign is an interface that is using a combination of various colors; more has to be processed

      Parameters:
      color -

      Color to change the sign text to. If null, then the default color will be used

    • getGate

      GateAPI getGate()
      Gets the gate belonging to this portal
      Returns:

      The gate belonging to this portal

    • close

      void close(long relatedOpenTime)
      Closes this portal

      Everytime most of the portals opens, there is going to be a scheduled event to close it after a specific time. If a player enters the portal before this, then it is going to close, but the scheduled close event is still going to be there. And if the portal gets activated again, it is going to close prematurely, because of this already scheduled event. Solution to avoid this is to assign an open-time for each scheduled close event and only close if the related open time matches with the most recent time the portal was opened.

      Parameters:
      relatedOpenTime -

      The time this portal was opened

    • getExit

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

      The exit location of this portal

    • getPortalPosition

      List<org.bukkit.Location> getPortalPosition(PositionType type)
      Gets the location of all positions of the specified portal position type
      Parameters:
      type -

      The type of portalPosition

      Returns:

      The location of this portal's signs

    • getActivatorUUID

      @Nullable @Nullable UUID getActivatorUUID()
      Returns:

      The uuid activator or null if portal is not active (or always on)

    • deactivate

      void deactivate()
      Deactivate this portal
    • getExitFacing

      org.bukkit.block.BlockFace getExitFacing()
      Get the facing entities exit from this portal.
      Returns:

      The facing entities exit from this portal.

    • getBehavior

      PortalBehavior getBehavior()
      Returns:

      The behavior which defines this portal destination selection and sign text

    • setBehavior

      void setBehavior(PortalBehavior portalBehavior)
      Modify the behavior this portal uses
      Parameters:
      portalBehavior -

      New behavior this portal should follow

    • redrawSigns

      void redrawSigns()
      Redraw all signs in this portal
    • activate

      void activate(org.bukkit.entity.Player player)
      Activates this portal for the given player during internally specified time
      Parameters:
      player -

      The player to activate this portal for

    • isActive

      boolean isActive()
      Returns:

      True if this portal is active

    • doTeleport

      void doTeleport(@NotNull @NotNull org.bukkit.entity.Entity target, @Nullable @Nullable Portal destination)
      Teleports the given entity to given destination
      Parameters:
      target -

      The entity to teleport

    • doTeleport

      void doTeleport(@NotNull @NotNull org.bukkit.entity.Entity target)
      Teleports the given entity to stored destination
      Parameters:
      target -

      The entity to teleport