Package com.velocitypowered.api.proxy
Interface ProxyServer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidbroadcast(net.kyori.text.Component component)Deprecated.@NonNull BossBarcreateBossBar(net.kyori.text.Component title, @NonNull BossBarColor color, @NonNull BossBarOverlay overlay, float progress)Deprecated.UseBossBarinsteadCollection<Player>getAllPlayers()Retrieves all players currently connected to this proxy.Collection<RegisteredServer>getAllServers()Retrieves allRegisteredServers registered with this proxy.InetSocketAddressgetBoundAddress()Gets the address that this proxy is bound to.ChannelRegistrargetChannelRegistrar()Gets theChannelRegistrarinstance.CommandManagergetCommandManager()Gets theCommandManagerinstance.ProxyConfiggetConfiguration()Gets theProxyConfiginstance.ConsoleCommandSourcegetConsoleCommandSource()Returns an instance ofCommandSourcethat can be used to determine if the command is being invoked by the console or a console-like executor.EventManagergetEventManager()Gets theEventManagerinstance.Optional<Player>getPlayer(String username)Retrieves the player currently connected to this proxy by their Minecraft username.Optional<Player>getPlayer(UUID uuid)Retrieves the player currently connected to this proxy by their Minecraft UUID.intgetPlayerCount()Returns the number of players currently connected to this proxy.PluginManagergetPluginManager()Gets thePluginManagerinstance.SchedulergetScheduler()Gets theSchedulerinstance.Optional<RegisteredServer>getServer(String name)Retrieves a registeredRegisteredServerinstance by its name.ProxyVersiongetVersion()Returns the version of the proxy.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.RegisteredServerregisterServer(ServerInfo server)Registers a server with this proxy.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.-
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, 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.
-
getPlayer
Optional<Player> getPlayer(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:
- an
Optionalwith the player, which may be empty
-
getPlayer
Optional<Player> getPlayer(UUID uuid)
Retrieves the player currently connected to this proxy by their Minecraft UUID.- Parameters:
uuid- the UUID- Returns:
- an
Optionalwith the player, which may be empty
-
broadcast
@Deprecated void broadcast(net.kyori.text.Component component)
Deprecated.Broadcasts a message to all players currently online.- Parameters:
component- the message to send
-
getAllPlayers
Collection<Player> getAllPlayers()
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
-
getPlayerCount
int getPlayerCount()
Returns the number of players currently connected to this proxy.- Returns:
- the players on this proxy
-
getServer
Optional<RegisteredServer> getServer(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
-
getAllServers
Collection<RegisteredServer> getAllServers()
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
-
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
-
getConsoleCommandSource
ConsoleCommandSource getConsoleCommandSource()
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
-
getPluginManager
PluginManager getPluginManager()
Gets thePluginManagerinstance.- Returns:
- the plugin manager instance
-
getEventManager
EventManager getEventManager()
Gets theEventManagerinstance.- Returns:
- the event manager instance
-
getCommandManager
CommandManager getCommandManager()
Gets theCommandManagerinstance.- Returns:
- the command manager
-
getChannelRegistrar
ChannelRegistrar getChannelRegistrar()
Gets theChannelRegistrarinstance.- Returns:
- the channel registrar
-
getBoundAddress
InetSocketAddress getBoundAddress()
Gets the address that this proxy is bound to. This does not necessarily indicate the external IP address of the proxy.- Returns:
- the address the proxy is bound to
-
getConfiguration
ProxyConfig getConfiguration()
Gets theProxyConfiginstance.- Returns:
- the proxy config
-
getVersion
ProxyVersion getVersion()
Returns the version of the proxy.- Returns:
- the proxy version
-
createBossBar
@Deprecated @NonNull BossBar createBossBar(net.kyori.text.Component title, @NonNull BossBarColor color, @NonNull BossBarOverlay overlay, float progress)
Deprecated.UseBossBarinsteadCreates a newBossBar.- Parameters:
title- boss bar titlecolor- boss bar coloroverlay- boss bar overlayprogress- boss bar progress- Returns:
- a completely new and fresh boss bar
-
-