Interface Portal
- All Known Subinterfaces:
RealPortal
- All Known Implementing Classes:
LegacyVirtualPortal
,StargatePortal
,VirtualPortal
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFlag
(PortalFlag flag) Add a flag from this portal (does not do so to storage)void
close
(boolean forceClose) Closes this portalvoid
destroy()
The method used when destroying a portalGets all of this portal's portal flags in the form of a stringGets the globally unique identifier for this portalgetId()
Gets the unique identifier for this portalgetName()
Gets the name of this portalGets the network this portal belongs toGets the UUID of this portal's ownerGets how the portal is storedboolean
hasFlag
(PortalFlag flag) Checks whether this portal has the given portal flag enabledboolean
boolean
isOpen()
Checks whether this portal is currently openboolean
isOpenFor
(org.bukkit.entity.Entity target) Checks whether this portal is currently open and the given target is the one the portal opened forvoid
open
(org.bukkit.entity.Player player) Opens this portal for the given playervoid
overrideDestination
(Portal destination) Forces this portal to temporarily go to the given destination regardless of the normal destination(s)void
removeFlag
(PortalFlag flag) Remove a flag from this portal (does not do so from storage)void
Changes the name of the portal.void
setNetwork
(Network targetNetwork) Changes the network this portal belongs tovoid
Changes the player this portal belongs tovoid
teleportHere
(org.bukkit.entity.Entity target, RealPortal origin) Teleports an entity to this portalvoid
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 portalMainly 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
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
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
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
Changes the player this portal belongs toDOES NOT SAVE TO DATABASE
- Parameters:
targetPlayer
-The new player this portal should belong to
-
hasFlag
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
Remove a flag from this portal (does not do so from storage)- Parameters:
flag
-Flag to remove
-
addFlag
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 stringThis 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 ownerA 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
Changes the name of the portal. UseNetworkManager.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
-