public interface ProxyServer
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(Component component)
Broadcasts a message to all players currently online.
|
@NonNull BossBar |
createBossBar(@NonNull Component title,
@NonNull BossBarColor color,
@NonNull BossBarOverlay overlay,
float progress)
Creates a new
BossBar. |
Collection<Player> |
getAllPlayers()
Retrieves all players currently connected to this proxy.
|
Collection<RegisteredServer> |
getAllServers()
Retrieves all
RegisteredServers registered with this proxy. |
InetSocketAddress |
getBoundAddress()
Gets the address that this proxy is bound to.
|
ChannelRegistrar |
getChannelRegistrar()
Gets the
ChannelRegistrar instance. |
CommandManager |
getCommandManager()
Gets the
CommandManager instance. |
ProxyConfig |
getConfiguration()
Gets the
ProxyConfig instance. |
ConsoleCommandSource |
getConsoleCommandSource()
Returns an instance of
CommandSource that can be used to determine if the command is
being invoked by the console or a console-like executor. |
EventManager |
getEventManager()
Gets the
EventManager instance. |
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.
|
int |
getPlayerCount()
Returns the number of players currently connected to this proxy.
|
PluginManager |
getPluginManager()
Gets the
PluginManager instance. |
Scheduler |
getScheduler()
Gets the
Scheduler instance. |
Optional<RegisteredServer> |
getServer(String name)
Retrieves a registered
RegisteredServer instance by its name. |
ProxyVersion |
getVersion()
Returns the version of the proxy.
|
Collection<Player> |
matchPlayer(String partialName)
Matches all
Players whose names start with the provided partial name. |
Collection<RegisteredServer> |
matchServer(String partialName)
Matches all
RegisteredServers whose names start with the provided partial name. |
RegisteredServer |
registerServer(ServerInfo server)
Registers a server with this proxy.
|
void |
unregisterServer(ServerInfo server)
Unregisters this server from the proxy.
|
Optional<Player> getPlayer(String username)
username - the username to search forOptional with the player, which may be emptyOptional<Player> getPlayer(UUID uuid)
uuid - the UUIDOptional with the player, which may be emptyvoid broadcast(Component component)
component - the message to sendCollection<Player> getAllPlayers()
int getPlayerCount()
Optional<RegisteredServer> getServer(String name)
RegisteredServer instance by its name. The search is
case-insensitive.name - the name of the serverCollection<RegisteredServer> getAllServers()
RegisteredServers registered with this proxy.Collection<Player> matchPlayer(String partialName)
Players whose names start with the provided partial name.partialName - the partial name to check forPlayersCollection<RegisteredServer> matchServer(String partialName)
RegisteredServers whose names start with the provided partial name.partialName - the partial name to check forRegisteredServersRegisteredServer registerServer(ServerInfo server)
server - the server to registervoid unregisterServer(ServerInfo server)
server - the server to unregisterConsoleCommandSource getConsoleCommandSource()
CommandSource that 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 own CommandSource instead of using the console
invoker.PluginManager getPluginManager()
PluginManager instance.EventManager getEventManager()
EventManager instance.CommandManager getCommandManager()
CommandManager instance.ChannelRegistrar getChannelRegistrar()
ChannelRegistrar instance.InetSocketAddress getBoundAddress()
ProxyConfig getConfiguration()
ProxyConfig instance.ProxyVersion getVersion()
@NonNull BossBar createBossBar(@NonNull Component title, @NonNull BossBarColor color, @NonNull BossBarOverlay overlay, float progress)
BossBar.title - boss bar titlecolor - boss bar coloroverlay - boss bar overlayprogress - boss bar progress