Package net.md_5.bungee.api
Class ProxyServer
- java.lang.Object
- 
- net.md_5.bungee.api.ProxyServer
 
- 
 public abstract class ProxyServer extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description ProxyServer()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidbroadcast(String message)Deprecated.abstract voidbroadcast(BaseComponent message)Send the specified message to the console and all connected players.abstract voidbroadcast(BaseComponent... message)Send the specified message to the console and all connected players.abstract ServerInfoconstructServerInfo(String name, InetSocketAddress address, String motd, boolean restricted)Factory method to construct an implementation specific server info instance.abstract ServerInfoconstructServerInfo(String name, SocketAddress address, String motd, boolean restricted)Factory method to construct an implementation specific server info instance.abstract TitlecreateTitle()Creates a new empty title configuration.abstract Collection<String>getChannels()Get an immutable set of all registered plugin channels.abstract ProxyConfiggetConfig()Gets BungeeCord's core config.abstract ConfigurationAdaptergetConfigurationAdapter()Returns the currently in use configuration adapter.abstract CommandSendergetConsole()Returns the console overlord for this proxy.abstract Collection<String>getDisabledCommands()Gets the commands which are disabled and will not be run on this proxy.abstract StringgetGameVersion()Deprecated.static ProxyServergetInstance()abstract LoggergetLogger()Gets the main logger which can be used as a suitable replacement forSystem.outandSystem.err.abstract StringgetName()Gets the name of the currently running proxy software.abstract intgetOnlineCount()Get the current number of connected users.abstract ProxiedPlayergetPlayer(String name)Gets a connected player via their unique username.abstract ProxiedPlayergetPlayer(UUID uuid)Gets a connected player via their UUIDabstract Collection<ProxiedPlayer>getPlayers()Return all players currently connected.abstract PluginManagergetPluginManager()Get thePluginManagerassociated with loading plugins and dispatching events.abstract FilegetPluginsFolder()Return the folder used to load plugins from.abstract intgetProtocolVersion()Deprecated.abstract ReconnectHandlergetReconnectHandler()Get the currently in use reconnect handler.abstract TaskSchedulergetScheduler()Get the scheduler instance for this proxy.abstract ServerInfogetServerInfo(String name)Gets the server info of a server.abstract Map<String,ServerInfo>getServers()Deprecated.The returned map is part of the proxy's internal state, and may be modified concurrently by the proxy.abstract Map<String,ServerInfo>getServersCopy()Return all servers registered to this proxy, keyed by name.abstract StringgetTranslation(String name, Object... args)Gets a localized string from the .properties file.abstract StringgetVersion()Gets the version of the currently running proxy software.abstract Collection<ProxiedPlayer>matchPlayer(String match)Attempts to match any players with the given name, and returns a list of all possible matches.abstract voidregisterChannel(String channel)Register a channel for use with plugin messages.abstract voidsetConfigurationAdapter(ConfigurationAdapter adapter)Set the configuration adapter to be used.static voidsetInstance(ProxyServer instance)Sets the proxy instance.abstract voidsetReconnectHandler(ReconnectHandler handler)Sets the reconnect handler to be used for subsequent connections.abstract voidstop()Gracefully mark this instance for shutdown.abstract voidstop(String reason)Gracefully mark this instance for shutdown.abstract voidunregisterChannel(String channel)Unregister a previously registered channel.
 
- 
- 
- 
Method Detail- 
setInstancepublic 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
 
 - 
getNamepublic abstract String getName() Gets the name of the currently running proxy software.- Returns:
- the name of this instance
 
 - 
getVersionpublic abstract String getVersion() Gets the version of the currently running proxy software.- Returns:
- the version of this instance
 
 - 
getTranslationpublic abstract String getTranslation(String name, Object... args) Gets a localized string from the .properties file.- Parameters:
- name- translation name
- args- translation arguments
- Returns:
- the localized string
 
 - 
getLoggerpublic abstract Logger getLogger() Gets the main logger which can be used as a suitable replacement forSystem.outandSystem.err.- Returns:
- the Loggerinstance
 
 - 
getPlayerspublic abstract Collection<ProxiedPlayer> getPlayers() Return all players currently connected.- Returns:
- all connected players
 
 - 
getPlayerpublic abstract ProxiedPlayer getPlayer(String name) Gets a connected player via their unique username.- Parameters:
- name- of the player
- Returns:
- their player instance
 
 - 
getPlayerpublic abstract ProxiedPlayer getPlayer(UUID uuid) Gets a connected player via their UUID- Parameters:
- uuid- of the player
- Returns:
- their player instance
 
 - 
getServers@Deprecated public abstract Map<String,ServerInfo> getServers() Deprecated.The returned map is part of the proxy's internal state, and may be modified concurrently by the proxy. The safe alternative isgetServersCopy().Return all servers registered to this proxy, keyed by name. Unlike the methods inConfigurationAdapter.getServers(), this will not return a fresh map each time.- Returns:
- all registered remote server destinations
 
 - 
getServersCopypublic abstract Map<String,ServerInfo> getServersCopy() Return all servers registered to this proxy, keyed by name. The returned map is an immutable snapshot of the actual server collection. It cannot be modified, and it will not change.- Returns:
- all registered remote server destinations
 
 - 
getServerInfopublic 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
 
 - 
getPluginManagerpublic abstract PluginManager getPluginManager() Get thePluginManagerassociated with loading plugins and dispatching events. It is recommended that implementations use the provided PluginManager class.- Returns:
- the plugin manager
 
 - 
getConfigurationAdapterpublic abstract ConfigurationAdapter getConfigurationAdapter() Returns the currently in use configuration adapter.- Returns:
- the used configuration adapter
 
 - 
setConfigurationAdapterpublic abstract void setConfigurationAdapter(ConfigurationAdapter adapter) Set the configuration adapter to be used. Must be called fromPlugin.onLoad().- Parameters:
- adapter- the adapter to use
 
 - 
getReconnectHandlerpublic abstract ReconnectHandler getReconnectHandler() Get the currently in use reconnect handler.- Returns:
- the in use reconnect handler
 
 - 
setReconnectHandlerpublic abstract void setReconnectHandler(ReconnectHandler handler) Sets the reconnect handler to be used for subsequent connections.- Parameters:
- handler- the new handler
 
 - 
stoppublic abstract void stop() Gracefully mark this instance for shutdown.
 - 
stoppublic abstract void stop(String reason) Gracefully mark this instance for shutdown.- Parameters:
- reason- the reason for stopping. This will be shown to players.
 
 - 
registerChannelpublic abstract void registerChannel(String channel) Register a channel for use with plugin messages. This is required by some server / client implementations.- Parameters:
- channel- the channel to register
 
 - 
unregisterChannelpublic abstract void unregisterChannel(String channel) Unregister a previously registered channel.- Parameters:
- channel- the channel to unregister
 
 - 
getChannelspublic abstract Collection<String> getChannels() Get an immutable set of all registered plugin channels.- Returns:
- registered plugin channels
 
 - 
getGameVersion@Deprecated public abstract String getGameVersion() Deprecated.Get the Minecraft version supported by this proxy.- Returns:
- the supported Minecraft version
 
 - 
getProtocolVersion@Deprecated public abstract int getProtocolVersion() Deprecated.Get the Minecraft protocol version supported by this proxy.- Returns:
- the Minecraft protocol version
 
 - 
constructServerInfopublic 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
 
 - 
constructServerInfopublic abstract ServerInfo constructServerInfo(String name, SocketAddress 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
 
 - 
getConsolepublic 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
 
 - 
getPluginsFolderpublic abstract File getPluginsFolder() Return the folder used to load plugins from.- Returns:
- the folder used to load plugin
 
 - 
getSchedulerpublic abstract TaskScheduler getScheduler() Get the scheduler instance for this proxy.- Returns:
- the in use scheduler
 
 - 
getOnlineCountpublic abstract int getOnlineCount() Get the current number of connected users. The default implementation is more efficient thangetPlayers()as it does not take a lock or make a copy.- Returns:
- the current number of connected players
 
 - 
broadcast@Deprecated public abstract void broadcast(String message) Deprecated.Send the specified message to the console and all connected players.- Parameters:
- message- the message to broadcast
 
 - 
broadcastpublic abstract void broadcast(BaseComponent... message) Send the specified message to the console and all connected players.- Parameters:
- message- the message to broadcast
 
 - 
broadcastpublic abstract void broadcast(BaseComponent message) Send the specified message to the console and all connected players.- Parameters:
- message- the message to broadcast
 
 - 
getDisabledCommandspublic abstract Collection<String> getDisabledCommands() Gets the commands which are disabled and will not be run on this proxy.- Returns:
- the set of disabled commands
 
 - 
getConfigpublic abstract ProxyConfig getConfig() Gets BungeeCord's core config.- Returns:
- the config.
 
 - 
matchPlayerpublic abstract Collection<ProxiedPlayer> matchPlayer(String match) Attempts to match any players with the given name, and returns a list of all possible matches. The exact algorithm to use to match players is implementation specific, but in general you can expect this method to return player's whose names begin with the specified prefix.- Parameters:
- match- the (partial) name to match
- Returns:
- list of all possible players, singleton if there is an exact match
 
 - 
createTitlepublic abstract Title createTitle() Creates a new empty title configuration. In most cases you will want toTitle.reset()the current title first so your title won't be affected by a previous one.- Returns:
- A new empty title configuration.
- See Also:
- Title
 
 - 
getInstancepublic static ProxyServer getInstance() 
 
- 
 
-