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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVirtualPortal(String server, String name, Network network, Set<PortalFlag> flags, UUID ownerUUID) Instantiates a new virtual portal -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFlag(PortalFlag flag) Add a flag from this portal (does not do so to storage)voidclose(boolean force) Closes this portalvoiddestroy()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 storedbooleanhasFlag(PortalFlag flag) Checks whether this portal has the given portal flag enabledbooleanbooleanisOpen()Checks whether this portal is currently openbooleanisOpenFor(org.bukkit.entity.Entity player) Checks whether this portal is currently open and the given target is the one the portal opened forvoidopen(org.bukkit.entity.Player player) Opens this portal for the given playervoidoverrideDestination(Portal destination) Forces this portal to temporarily go to the given destination regardless of the normal destination(s)voidremoveFlag(PortalFlag flag) Remove a flag from this portal (does not do so from storage)voidChanges the name of the portal.voidsetNetwork(Network targetNetwork) Changes the network this portal belongs tovoidChanges the player this portal belongs tovoidteleportHere(org.bukkit.entity.Entity target, RealPortal origin) Teleports an entity to this portalvoidLooks 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:PortalTeleports an entity to this portal- Specified by:
teleportHerein 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:PortalCloses this portal -
getName
Description copied from interface:PortalGets the name of this portal -
setNetwork
Description copied from interface:PortalChanges the network this portal belongs to- Specified by:
setNetworkin interfacePortal- Parameters:
targetNetwork-The new network this portal should belong to
-
overrideDestination
Description copied from interface:PortalForces this portal to temporarily go to the given destination regardless of the normal destination(s)- Specified by:
overrideDestinationin interfacePortal- Parameters:
destination-The destination this portal should temporarily connect ot
-
getNetwork
Description copied from interface:PortalGets the network this portal belongs to- Specified by:
getNetworkin interfacePortal- Returns:
The network this portal belongs to
-
open
public void open(org.bukkit.entity.Player player) Description copied from interface:PortalOpens this portal for the given player -
destroy
public void destroy()Description copied from interface:PortalThe 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:PortalChecks whether this portal is currently open -
isOpenFor
public boolean isOpenFor(org.bukkit.entity.Entity player) Description copied from interface:PortalChecks whether this portal is currently open and the given target is the one the portal opened for -
getAllFlagsString
Description copied from interface:PortalGets 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:
getAllFlagsStringin interfacePortal- Returns:
All of this portal's portal flags in the form of a string
-
getOwnerUUID
Description copied from interface:PortalGets the UUID of this portal's ownerA portal's owner is the player that created the portal.
- Specified by:
getOwnerUUIDin interfacePortal- Returns:
The UUID of this portal's owner
-
updateState
public void updateState()Description copied from interface:PortalLooks into available portals to connect to, and updates appearance and behaviour accordingly- Specified by:
updateStatein interfacePortal
-
setOwner
Description copied from interface:PortalChanges the player this portal belongs toDOES NOT SAVE TO DATABASE
-
hasFlag
Description copied from interface:PortalChecks whether this portal has the given portal flag enabled -
removeFlag
Description copied from interface:PortalRemove a flag from this portal (does not do so from storage)- Specified by:
removeFlagin interfacePortal- Parameters:
flag-Flag to remove
-
addFlag
Description copied from interface:PortalAdd a flag from this portal (does not do so to storage) -
getId
Description copied from interface:PortalGets the unique identifier for this portal -
getGlobalId
Description copied from interface:PortalGets the globally unique identifier for this portal- Specified by:
getGlobalIdin interfacePortal- Returns:
The globally unique identifier for this portal
-
getServer
- Returns:
The server this portal is contained within
-
getStorageType
Description copied from interface:PortalGets how the portal is stored- Specified by:
getStorageTypein interfacePortal- Returns:
The storage type of the portal
-
setName
Description copied from interface:PortalChanges 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:
isDestroyedin interfacePortal- Returns:
True if this portal has been destroyed
-