Interface RealPortal
- All Superinterfaces:
MetadataHolder
,Portal
- All Known Implementing Classes:
StargatePortal
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(org.bukkit.entity.Player player) Activates this portal for the given player during internally specified timevoid
close
(long relatedOpenTime) Closes this portalvoid
Deactivate this portalvoid
doTeleport
(@NotNull org.bukkit.entity.Entity target) Teleports the given entity to stored destinationvoid
doTeleport
(@NotNull org.bukkit.entity.Entity target, @Nullable Portal destination) Teleports the given entity to given destination@Nullable UUID
org.bukkit.Location
getExit()
Gets the exit location of this portalorg.bukkit.block.BlockFace
Get the facing entities exit from this portal.getGate()
Gets the gate belonging to this portalList
<org.bukkit.Location> Gets the location of all positions of the specified portal position typeboolean
isActive()
void
Open this portal without any checksvoid
Redraw all signs in this portalvoid
setBehavior
(PortalBehavior portalBehavior) Modify the behavior this portal usesvoid
setSignColor
(org.bukkit.DyeColor color, PortalPosition portalPosition) Updates the color of this portal's signMethods inherited from interface org.sgrewritten.stargate.api.MetadataHolder
getMetadata, getMetadata, setMetadata, setMetadata
Methods inherited from interface org.sgrewritten.stargate.api.network.portal.Portal
addFlag, close, destroy, getAllFlagsString, getGlobalId, getId, getName, getNetwork, getOwnerUUID, getStorageType, hasFlag, isDestroyed, isOpen, isOpenFor, open, overrideDestination, removeFlag, setName, setNetwork, setOwner, teleportHere, updateState
-
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
Updates the color of this portal's signReplacement 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 portalEverytime 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
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
- 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
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
-