Package com.velocitypowered.api.proxy
Interface ProxyServer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelRegistrarchannelRegistrar()Gets theChannelRegistrarinstance.CommandManagercommandManager()Gets theCommandManagerinstance.ProxyConfigconfiguration()Gets theProxyConfiginstance.Collection<Player>connectedPlayers()Retrieves all players currently connected to this proxy.ConsoleCommandSourceconsoleCommandSource()Returns an instance ofCommandSourcethat can be used to determine if the command is being invoked by the console or a console-like executor.intcountConnectedPlayers()Returns the number of players currently connected to this proxy.RegisteredServercreateRawRegisteredServer(ServerInfo server)Creates a rawRegisteredServerwithout tying it into the internal server map.Collection<NetworkEndpoint>endpoints()Returns all the endpoints the proxy is listening on.EventManagereventManager()Gets theEventManagerinstance.Collection<Player>matchPlayer(String partialName)Matches allPlayers whose names start with the provided partial name.Collection<RegisteredServer>matchServer(String partialName)Matches allRegisteredServers whose names start with the provided partial name.@Nullable Playerplayer(String username)Retrieves the player currently connected to this proxy by their Minecraft username.@Nullable Playerplayer(UUID uuid)Retrieves the player currently connected to this proxy by their Minecraft UUID.PluginManagerpluginManager()Gets thePluginManagerinstance.Collection<RegisteredServer>registeredServers()Retrieves allRegisteredServers registered with this proxy.RegisteredServerregisterServer(ServerInfo server)Registers a server with this proxy.Schedulerscheduler()Gets theSchedulerinstance.@Nullable RegisteredServerserver(String name)Retrieves a registeredRegisteredServerinstance by its name.voidshutdown()Shuts down the proxy, kicking players with the default reason.voidshutdown(Component reason)Shuts down the proxy, kicking players with the specifiedreason.voidunregisterServer(ServerInfo server)Unregisters this server from the proxy.ProxyVersionversion()Returns the version of the proxy.-
Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound
-
-
-
-
Method Detail
-
shutdown
void shutdown(Component reason)
Shuts down the proxy, kicking players with the specifiedreason.- Parameters:
reason- message to kick online players with
-
shutdown
void shutdown()
Shuts down the proxy, kicking players with the default reason.
-
player
@Nullable Player player(String username)
Retrieves the player currently connected to this proxy by their Minecraft username. The search is case-insensitive.- Parameters:
username- the username to search for- Returns:
- the player instance, if connected, else
null
-
player
@Nullable Player player(UUID uuid)
Retrieves the player currently connected to this proxy by their Minecraft UUID.- Parameters:
uuid- the UUID- Returns:
- the player instance, if connected, else
null
-
connectedPlayers
Collection<Player> connectedPlayers()
Retrieves all players currently connected to this proxy. This call may or may not be a snapshot of all players online.- Returns:
- the players online on this proxy
-
countConnectedPlayers
int countConnectedPlayers()
Returns the number of players currently connected to this proxy.- Returns:
- the players on this proxy
-
server
@Nullable RegisteredServer server(String name)
Retrieves a registeredRegisteredServerinstance by its name. The search is case-insensitive.- Parameters:
name- the name of the server- Returns:
- the registered server, which may be empty
-
registeredServers
Collection<RegisteredServer> registeredServers()
Retrieves allRegisteredServers registered with this proxy.- Returns:
- the servers registered with this proxy
-
matchPlayer
Collection<Player> matchPlayer(String partialName)
Matches allPlayers whose names start with the provided partial name.- Parameters:
partialName- the partial name to check for- Returns:
- a collection of mathed
Players
-
matchServer
Collection<RegisteredServer> matchServer(String partialName)
Matches allRegisteredServers whose names start with the provided partial name.- Parameters:
partialName- the partial name to check for- Returns:
- a collection of mathed
RegisteredServers
-
createRawRegisteredServer
RegisteredServer createRawRegisteredServer(ServerInfo server)
Creates a rawRegisteredServerwithout tying it into the internal server map.- Parameters:
server- the server to register- Returns:
- the
RegisteredServerimplementation created by the providedServerInfo.
-
registerServer
RegisteredServer registerServer(ServerInfo server)
Registers a server with this proxy. A server with this name should not already exist.- Parameters:
server- the server to register- Returns:
- the newly registered server
-
unregisterServer
void unregisterServer(ServerInfo server)
Unregisters this server from the proxy.- Parameters:
server- the server to unregister
-
consoleCommandSource
ConsoleCommandSource consoleCommandSource()
Returns an instance ofCommandSourcethat can be used to determine if the command is being invoked by the console or a console-like executor. Plugins that execute commands are strongly urged to implement their ownCommandSourceinstead of using the console invoker.- Returns:
- the console command invoker
-
pluginManager
PluginManager pluginManager()
Gets thePluginManagerinstance.- Returns:
- the plugin manager instance
-
eventManager
EventManager eventManager()
Gets theEventManagerinstance.- Returns:
- the event manager instance
-
commandManager
CommandManager commandManager()
Gets theCommandManagerinstance.- Returns:
- the command manager
-
channelRegistrar
ChannelRegistrar channelRegistrar()
Gets theChannelRegistrarinstance.- Returns:
- the channel registrar
-
configuration
ProxyConfig configuration()
Gets theProxyConfiginstance.- Returns:
- the proxy config
-
version
ProxyVersion version()
Returns the version of the proxy.- Returns:
- the proxy version
-
endpoints
Collection<NetworkEndpoint> endpoints()
Returns all the endpoints the proxy is listening on. This collection is immutable.- Returns:
- all the endpoints the proxy is listening on
-
-