Class ServerImpl

java.lang.Object
net.md_5.bungee.BungeeServerInfo
net.ME1312.SubServers.Bungee.Host.ServerImpl
All Implemented Interfaces:
ServerInfo, ExtraDataHandler<String>, ClientHandler, SubDataSerializable, Server
Direct Known Subclasses:
SubServerImpl

public class ServerImpl extends BungeeServerInfo implements Server
Server Class
  • Constructor Details

  • Method Details

    • construct

      public static ServerImpl construct(String name, SocketAddress address, String motd, boolean hidden, boolean restricted) throws InvalidServerException
      Construct a new Server data type
      Parameters:
      name - Server name
      address - Server Address
      motd - Server MOTD
      hidden - Hidden Status
      restricted - Restricted Status
      Returns:
      Throws:
      InvalidServerException
    • isRegistered

      protected boolean isRegistered()
      Get if this server has been registered
      Returns:
      Registered status
    • getSubData

      public DataClient[] getSubData()
      Specified by:
      getSubData in interface ClientHandler
    • setSubData

      public void setSubData(DataClient client, int channel)
      Description copied from interface: Server
      Link a SubData Client to this Object
      Specified by:
      setSubData in interface Server
      Parameters:
      client - Client to Link
      channel - Channel ID
    • removeSubData

      public void removeSubData(DataClient client)
      Specified by:
      removeSubData in interface ClientHandler
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: Server
      Get the Display Name of this Server
      Specified by:
      getDisplayName in interface Server
      Returns:
      Display Name
    • setDisplayName

      public void setDisplayName(String value)
      Description copied from interface: Server
      Sets the Display Name for this Server
      Specified by:
      setDisplayName in interface Server
      Parameters:
      value - Value (or null to reset)
    • getGroups

      public List<String> getGroups()
      Description copied from interface: Server
      Get this Server's Groups
      Specified by:
      getGroups in interface Server
      Returns:
      Group names
    • addGroup

      public void addGroup(String value)
      Description copied from interface: Server
      Add this Server to a Group
      Specified by:
      addGroup in interface Server
      Parameters:
      value - Group name
    • removeGroup

      public void removeGroup(String value)
      Description copied from interface: Server
      Remove this Server from a Group
      Specified by:
      removeGroup in interface Server
      Parameters:
      value - value Group name
    • command

      public boolean command(UUID player, UUID target, String command)
      Description copied from interface: Server
      Commands the Server
      Specified by:
      command in interface Server
      Parameters:
      player - Player who's Commanding
      target - Player who will Send
      command - Command to Send
    • getRemotePlayers

      public Collection<RemotePlayer> getRemotePlayers()
      Description copied from interface: Server
      Get players on this server across all known proxies
      Specified by:
      getRemotePlayers in interface Server
      Returns:
      Remote Player Collection
    • isHidden

      public boolean isHidden()
      Description copied from interface: Server
      If the server is hidden from players
      Specified by:
      isHidden in interface Server
      Returns:
      Hidden Status
    • setHidden

      public void setHidden(boolean value)
      Description copied from interface: Server
      Set if the server is hidden from players
      Specified by:
      setHidden in interface Server
      Parameters:
      value - Value
    • setMotd

      public void setMotd(String value)
      Description copied from interface: Server
      Sets the MOTD of the Server
      Specified by:
      setMotd in interface Server
      Parameters:
      value - Value
    • setRestricted

      public void setRestricted(boolean value)
      Description copied from interface: Server
      Sets if the Server is Restricted
      Specified by:
      setRestricted in interface Server
      Parameters:
      value - Value
    • canAccess

      public boolean canAccess(CommandSender player)
      See if a player can access this server
      Specified by:
      canAccess in interface ServerInfo
      Overrides:
      canAccess in class BungeeServerInfo
      Parameters:
      player - Player
      Returns:
      Whitelisted Status
    • getWhitelist

      public Collection<UUID> getWhitelist()
      Description copied from interface: Server
      Get a copy of the current whitelist
      Specified by:
      getWhitelist in interface Server
      Returns:
      Player Whitelist
    • isWhitelisted

      public boolean isWhitelisted(UUID player)
      Description copied from interface: Server
      See if a player is whitelisted
      Specified by:
      isWhitelisted in interface Server
      Parameters:
      player - Player to check
      Returns:
      Whitelisted Status
    • whitelist

      public void whitelist(UUID player)
      Description copied from interface: Server
      Add a player to the whitelist (for use with restricted servers)
      Specified by:
      whitelist in interface Server
      Parameters:
      player - Player to add
    • unwhitelist

      public void unwhitelist(UUID player)
      Description copied from interface: Server
      Remove a player to the whitelist
      Specified by:
      unwhitelist in interface Server
      Parameters:
      player - Player to remove
    • persist

      public final void persist()
      Description copied from interface: Server
      Makes it so the server object will still exist within the server manager even if it is disconnected
      Specified by:
      persist in interface Server
    • getSignature

      public final String getSignature()
      Description copied from interface: Server
      Get the Signature of this Object
      Specified by:
      getSignature in interface Server
      Returns:
      Object Signature
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class BungeeServerInfo
    • addExtra

      public void addExtra(String handle, Object value)
      Specified by:
      addExtra in interface ExtraDataHandler<String>
    • hasExtra

      public boolean hasExtra(String handle)
      Specified by:
      hasExtra in interface ExtraDataHandler<String>
    • getExtra

      public ObjectMapValue getExtra(String handle)
      Specified by:
      getExtra in interface ExtraDataHandler<String>
    • getExtra

      public ObjectMap<String> getExtra()
      Specified by:
      getExtra in interface ExtraDataHandler<String>
    • removeExtra

      public void removeExtra(String handle)
      Specified by:
      removeExtra in interface ExtraDataHandler<String>
    • forSubData

      public ObjectMap<String> forSubData()
      Specified by:
      forSubData in interface ClientHandler
      Specified by:
      forSubData in interface SubDataSerializable