Class ProxyServer

java.lang.Object
net.md_5.bungee.api.ProxyServer

public abstract class ProxyServer extends Object
  • Constructor Details

    • ProxyServer

      public ProxyServer()
  • Method Details

    • setInstance

      public static void setInstance(ProxyServer instance)
      Sets the proxy instance. This method may only be called once per an application.
      Parameters:
      instance - the new instance to set
    • getName

      public abstract String getName()
      Gets the name of the currently running proxy software.
      Returns:
      the name of this instance
    • getVersion

      public abstract String getVersion()
      Gets the version of the currently running proxy software.
      Returns:
      the version of this instance
    • getTranslation

      public abstract String getTranslation(String name, Object... args)
      Gets a localized string from the .properties file.
      Returns:
      the localized string
    • getLogger

      public abstract Logger getLogger()
      Gets the main logger which can be used as a suitable replacement for System.out and System.err.
      Returns:
      the Logger instance
    • getPlayers

      public abstract Collection<ProxiedPlayer> getPlayers()
      Return all players currently connected.
      Returns:
      all connected players
    • getPlayer

      public abstract ProxiedPlayer getPlayer(String name)
      Gets a connected player via their unique username.
      Parameters:
      name - of the player
      Returns:
      their player instance
    • getServers

      public abstract Map<String,ServerInfo> getServers()
      Return all servers registered to this proxy, keyed by name. Unlike the methods in ConfigurationAdapter.getServers(), this will not return a fresh map each time.
      Returns:
      all registered remote server destinations
    • getServerInfo

      public abstract ServerInfo getServerInfo(String name)
      Gets the server info of a server.
      Parameters:
      name - the name of the configured server
      Returns:
      the server info belonging to the specified server
    • getPluginManager

      public abstract PluginManager getPluginManager()
      Get the PluginManager associated with loading plugins and dispatching events. It is recommended that implementations use the provided PluginManager class.
      Returns:
      the plugin manager
    • getConfigurationAdapter

      public abstract ConfigurationAdapter getConfigurationAdapter()
      Returns the currently in use configuration adapter.
      Returns:
      the used configuration adapter
    • setConfigurationAdapter

      public abstract void setConfigurationAdapter(ConfigurationAdapter adapter)
      Set the configuration adapter to be used. Must be called from Plugin.onLoad().
      Parameters:
      adapter - the adapter to use
    • getReconnectHandler

      public abstract ReconnectHandler getReconnectHandler()
      Get the currently in use reconnect handler.
      Returns:
      the in use reconnect handler
    • setReconnectHandler

      public abstract void setReconnectHandler(ReconnectHandler handler)
      Sets the reconnect handler to be used for subsequent connections.
      Parameters:
      handler - the new handler
    • stop

      public abstract void stop()
      Gracefully mark this instance for shutdown.
    • start

      public abstract void start() throws Exception
      Start this instance so that it may accept connections.
      Throws:
      Exception - any exception thrown during startup causing the instance to fail to boot
    • getGameVersion

      public abstract String getGameVersion()
      Get the Minecraft version supported by this proxy.
      Returns:
      the supported Minecraft version
    • getProtocolVersion

      public abstract byte getProtocolVersion()
      Get the Minecraft protocol version supported by this proxy.
      Returns:
      the Minecraft protocol version
    • constructServerInfo

      public abstract ServerInfo constructServerInfo(String name, InetSocketAddress address, String motd, boolean restricted)
      Factory method to construct an implementation specific server info instance.
      Parameters:
      name - name of the server
      address - connectable Minecraft address + port of the server
      motd - the motd when used as a forced server
      restricted - whether the server info restricted property will be set
      Returns:
      the constructed instance
    • getConsole

      public abstract CommandSender getConsole()
      Returns the console overlord for this proxy. Being the console, this command server cannot have permissions or groups, and will be able to execute anything.
      Returns:
      the console command sender of this proxy
    • getPluginsFolder

      public abstract File getPluginsFolder()
      Return the folder used to load plugins from.
      Returns:
      the folder used to load plugin
    • getScheduler

      public abstract TaskScheduler getScheduler()
      Get the scheduler instance for this proxy.
      Returns:
      the in use scheduler
    • getOnlineCount

      public abstract int getOnlineCount()
      Get the current number of connected users. The default implementation is more efficient than getPlayers() as it does not take a lock or make a copy.
      Returns:
      the current number of connected players
    • broadcast

      public abstract void broadcast(String message)
      Send the specified message to the console and all connected players.
      Parameters:
      message - the message to broadcast
    • getDisabledCommands

      public abstract Collection<String> getDisabledCommands()
      Gets the commands which are disabled and will not be run on this proxy.
      Returns:
      the set of disabled commands