Class VirtualPortal
- All Implemented Interfaces:
Portal
- Direct Known Subclasses:
LegacyVirtualPortal
A virtual portal, which does not exist. Symbolises a portal that is outside this server and acts as an interface to send relevant inter-server packets.
- Author:
- Thorin
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVirtualPortal
(String server, String name, Network network, Set<PortalFlag> flags, UUID ownerUUID) Instantiates a new virtual portal -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFlag
(PortalFlag flag) Add a flag from this portal (does not do so to storage)void
close
(boolean force) 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 player) 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
-
Field Details
-
server
-
-
Constructor Details
-
VirtualPortal
public VirtualPortal(String server, String name, Network network, Set<PortalFlag> flags, UUID ownerUUID) Instantiates a new virtual portal- Parameters:
server
-The name of the server this portal belongs to
name
-The name of this portal
network
-The network this virtual portal belongs to
flags
-The portal flags enabled for this virtual portal
ownerUUID
-The UUID of this virtual portal's owner
-
-
Method Details
-
teleportHere
Description copied from interface:Portal
Teleports an entity to this portal- Specified by:
teleportHere
in interfacePortal
- Parameters:
target
-The target entity to teleport
origin
-The origin portal the entity is teleporting from
-
close
public void close(boolean force) Description copied from interface:Portal
Closes this portal -
getName
Description copied from interface:Portal
Gets the name of this portal -
setNetwork
Description copied from interface:Portal
Changes the network this portal belongs to- Specified by:
setNetwork
in interfacePortal
- Parameters:
targetNetwork
-The new network this portal should belong to
-
overrideDestination
Description copied from interface:Portal
Forces this portal to temporarily go to the given destination regardless of the normal destination(s)- Specified by:
overrideDestination
in interfacePortal
- Parameters:
destination
-The destination this portal should temporarily connect ot
-
getNetwork
Description copied from interface:Portal
Gets the network this portal belongs to- Specified by:
getNetwork
in interfacePortal
- Returns:
The network this portal belongs to
-
open
public void open(org.bukkit.entity.Player player) Description copied from interface:Portal
Opens this portal for the given player -
destroy
public void destroy()Description copied from interface:Portal
The method used when destroying a portalMainly clears the sign, see
NetworkManager.destroyPortal(RealPortal)
to really destroy a portal -
isOpen
public boolean isOpen()Description copied from interface:Portal
Checks whether this portal is currently open -
isOpenFor
public boolean isOpenFor(org.bukkit.entity.Entity player) Description copied from interface:Portal
Checks whether this portal is currently open and the given target is the one the portal opened for -
getAllFlagsString
Description copied from interface:Portal
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.
- Specified by:
getAllFlagsString
in interfacePortal
- Returns:
All of this portal's portal flags in the form of a string
-
getOwnerUUID
Description copied from interface:Portal
Gets the UUID of this portal's ownerA portal's owner is the player that created the portal.
- Specified by:
getOwnerUUID
in interfacePortal
- Returns:
The UUID of this portal's owner
-
updateState
public void updateState()Description copied from interface:Portal
Looks into available portals to connect to, and updates appearance and behaviour accordingly- Specified by:
updateState
in interfacePortal
-
setOwner
Description copied from interface:Portal
Changes the player this portal belongs toDOES NOT SAVE TO DATABASE
-
hasFlag
Description copied from interface:Portal
Checks whether this portal has the given portal flag enabled -
removeFlag
Description copied from interface:Portal
Remove a flag from this portal (does not do so from storage)- Specified by:
removeFlag
in interfacePortal
- Parameters:
flag
-Flag to remove
-
addFlag
Description copied from interface:Portal
Add a flag from this portal (does not do so to storage) -
getId
Description copied from interface:Portal
Gets the unique identifier for this portal -
getGlobalId
Description copied from interface:Portal
Gets the globally unique identifier for this portal- Specified by:
getGlobalId
in interfacePortal
- Returns:
The globally unique identifier for this portal
-
getServer
- Returns:
The server this portal is contained within
-
getStorageType
Description copied from interface:Portal
Gets how the portal is stored- Specified by:
getStorageType
in interfacePortal
- Returns:
The storage type of the portal
-
setName
Description copied from interface:Portal
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. -
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfacePortal
- Returns:
True if this portal has been destroyed
-