Interface Network

All Known Implementing Classes:
StargateNetwork

public interface Network
A description of a network
  • Method Details

    • getAllPortals

      Collection<Portal> getAllPortals()
      Gets all portals belonging to this network
      Returns:

      All portals belonging to this network

    • getPortal

      Portal getPortal(String name)
      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

      void removePortal(Portal portal)
      Removes the given portal from this network
      Parameters:
      portal -

      The portal to remove

    • addPortal

      void addPortal(Portal portal) throws NameConflictException
      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

      boolean isPortalNameTaken(String name)
      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

      Set<String> getAvailablePortals(org.bukkit.entity.Player player, Portal requester)
      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

      void assignToRegistry(RegistryAPI registry)
      Assign the network to a registry
      Parameters:
      registry -

      The registry API to register to

    • canSeePortal

      boolean canSeePortal(Portal portalToSee, Portal origin, org.bukkit.entity.Player player)
      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

      Change the name of the network

      Does 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

      @Internal void renamePortal(String newName, String oldName) throws InvalidNameException
      Renames the portal, does not save to database and is also not cross server compatible. Instead use NetworkManager.rename(Portal, String)
      Parameters:
      newName -
      oldName -
      Throws:
      InvalidNameException