Interface Network
- All Known Implementing Classes:
StargateNetwork
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given portal to this networkvoid
assignToRegistry
(RegistryAPI registry) Assign the network to a registryboolean
canSeePortal
(Portal portalToSee, Portal origin, org.bukkit.entity.Player player) Whether the origin portal can list / choose the portal to see.void
destroy()
Destroys this network and every portal contained in itGets all portals belonging to this networkgetAvailablePortals
(org.bukkit.entity.Player player, Portal requester) Gets names of all portals available to the given player from the given portalGets the style this network should be highlighted with by defaultgetId()
Gets the unique identifier for this networkgetName()
Gets the name of this networkGets the portal with the given nameGets how the network is storedgetType()
Gets the NetworkType of this networkboolean
isPortalNameTaken
(String name) Checks whether there is already a portal in this network with the given namevoid
removePortal
(Portal portal) Removes the given portal from this networkvoid
renamePortal
(String newName, String oldName) Renames the portal, does not save to database and is also not cross server compatible.void
Change the name of the networkint
size()
Gets the current number of portals in this networkvoid
Updates all portals in this network
-
Method Details
-
getAllPortals
Collection<Portal> getAllPortals()Gets all portals belonging to this network- Returns:
All portals belonging to this network
-
getPortal
Gets the portal with the given name- Parameters:
name
-The name of the portal to get
- Returns:
The portal with the given name, or null if not found
-
removePortal
Removes the given portal from this network- Parameters:
portal
-The portal to remove
-
addPortal
Adds the given portal to this network- Parameters:
portal
-The portal to add
- Throws:
NameConflictException
-if portal a portal with that name already exist in the network
-
isPortalNameTaken
Checks whether there is already a portal in this network with the given name- Parameters:
name
-The name to check for
- Returns:
True if an existing portal is already using the given name
-
updatePortals
void updatePortals()Updates all portals in this network -
getAvailablePortals
Gets names of all portals available to the given player from the given portal- Parameters:
player
-The player to get portals
requester
-The portal the player is viewing other portals from
- Returns:
The names of all portals the player is allowed to see
-
destroy
void destroy()Destroys this network and every portal contained in it -
getName
String getName()Gets the name of this network- Returns:
The name of this network
-
size
int size()Gets the current number of portals in this network- Returns:
The size of this network
-
assignToRegistry
Assign the network to a registry- Parameters:
registry
-The registry API to register to
-
canSeePortal
Whether the origin portal can list / choose the portal to see.- Parameters:
portalToSee
-The portal to see
origin
-The requesting portal
player
-The actor initiating this request
- Returns:
True if the origin portal and player has permission
-
getHighlightingStyle
HighlightingStyle getHighlightingStyle()Gets the style this network should be highlighted with by default- Returns:
The highlighting style of this network
-
getId
String getId()Gets the unique identifier for this network- Returns:
The unique identifier for this network
-
getType
NetworkType getType()Gets the NetworkType of this network- Returns:
The NetworkType of this network
-
getStorageType
StorageType getStorageType()Gets how the network is stored- Returns:
The storage type of the portal
-
setID
@Internal void setID(String newName) throws InvalidNameException, NameLengthException, UnimplementedFlagException Change the name of the networkDoes not save to database. Use
NetworkManager.rename(Network, String)
instead.- Parameters:
newName
-The new name of the network
- Throws:
InvalidNameException
NameLengthException
UnimplementedFlagException
-
getPluginMessageSender
PluginMessageSender getPluginMessageSender()- Returns:
The plugin message sender
-
renamePortal
Renames the portal, does not save to database and is also not cross server compatible. Instead useNetworkManager.rename(Portal, String)
- Parameters:
newName
-oldName
-- Throws:
InvalidNameException
-