public interface ProxiedPlayer extends Connection, CommandSender
Modifier and Type | Interface and Description |
---|---|
static class |
ProxiedPlayer.ChatMode
Represents the player's chat state.
|
static class |
ProxiedPlayer.MainHand |
Connection.Unsafe
Modifier and Type | Method and Description |
---|---|
void |
chat(String message)
Make this player chat (say something), to the server he is currently on.
|
void |
connect(ServerConnectRequest request)
Connects / transfers this user to the specified connection, gracefully
closing the current one.
|
void |
connect(ServerInfo target)
Connects / transfers this user to the specified connection, gracefully
closing the current one.
|
void |
connect(ServerInfo target,
Callback<Boolean> callback)
Connects / transfers this user to the specified connection, gracefully
closing the current one.
|
void |
connect(ServerInfo target,
Callback<Boolean> callback,
ServerConnectEvent.Reason reason)
Connects / transfers this user to the specified connection, gracefully
closing the current one.
|
void |
connect(ServerInfo target,
ServerConnectEvent.Reason reason)
Connects / transfers this user to the specified connection, gracefully
closing the current one.
|
ProxiedPlayer.ChatMode |
getChatMode()
Gets this player's chat mode.
|
String |
getDisplayName()
Gets this player's display name.
|
Locale |
getLocale()
Gets this player's locale.
|
ProxiedPlayer.MainHand |
getMainHand()
Gets this player's main hand setting.
|
Map<String,String> |
getModList()
Gets this player's Forge Mod List, if the player has sent this
information during the lifetime of their connection to Bungee.
|
PendingConnection |
getPendingConnection()
Get the pending connection that belongs to this player.
|
int |
getPing()
Gets the ping time between the proxy and this connection.
|
ServerInfo |
getReconnectServer()
Get the server which this player will be sent to next time the log in.
|
Scoreboard |
getScoreboard()
Get the
Scoreboard that belongs to this player. |
Server |
getServer()
Gets the server this player is connected to.
|
SkinConfiguration |
getSkinParts()
Gets this player's skin settings.
|
UUID |
getUniqueId()
Get this connection's UUID, if set.
|
String |
getUUID()
Deprecated.
In favour of
getUniqueId() |
byte |
getViewDistance()
Gets this player's view distance.
|
boolean |
hasChatColors()
Gets if this player has chat colors enabled or disabled.
|
boolean |
isForgeUser()
Gets whether this player is using a FML client.
|
void |
resetTabHeader()
Clears the header and footer displayed in the tab player list.
|
void |
sendData(String channel,
byte[] data)
Send a plugin message to this player.
|
void |
sendMessage(ChatMessageType position,
BaseComponent... message)
Send a message to the specified screen position of this player.
|
void |
sendMessage(ChatMessageType position,
BaseComponent message)
Send a message to the specified screen position of this player.
|
void |
sendTitle(Title title)
Sends a
Title to this player. |
void |
setDisplayName(String name)
Sets this players display name to be used as their nametag and tab list
name.
|
void |
setReconnectServer(ServerInfo server)
Set the server which this player will be sent to next time the log in.
|
void |
setTabHeader(BaseComponent[] header,
BaseComponent[] footer)
Set the header and footer displayed in the tab player list.
|
void |
setTabHeader(BaseComponent header,
BaseComponent footer)
Set the header and footer displayed in the tab player list.
|
disconnect, disconnect, disconnect, getAddress, getSocketAddress, isConnected, unsafe
addGroups, getGroups, getName, getPermissions, hasPermission, removeGroups, sendMessage, sendMessage, sendMessage, sendMessages, setPermission
String getDisplayName()
void setDisplayName(String name)
name
- the name to setvoid sendMessage(ChatMessageType position, BaseComponent... message)
position
- the screen positionmessage
- the message to sendvoid sendMessage(ChatMessageType position, BaseComponent message)
position
- the screen positionmessage
- the message to sendvoid connect(ServerInfo target)
target
- the new server to connect tovoid connect(ServerInfo target, ServerConnectEvent.Reason reason)
target
- the new server to connect toreason
- the reason for connecting to the new servervoid connect(ServerInfo target, Callback<Boolean> callback)
target
- the new server to connect tocallback
- the method called when the connection is complete, or
when an exception is encountered. The boolean parameter denotes success
(true) or failure (false).void connect(ServerInfo target, Callback<Boolean> callback, ServerConnectEvent.Reason reason)
target
- the new server to connect tocallback
- the method called when the connection is complete, or
when an exception is encountered. The boolean parameter denotes success
(true) or failure (false).reason
- the reason for connecting to the new servervoid connect(ServerConnectRequest request)
request
- request to connect withServer getServer()
int getPing()
void sendData(String channel, byte[] data)
channel
- the channel to send this data viadata
- the data to sendPendingConnection getPendingConnection()
void chat(String message)
message
- the message to sayServerInfo getReconnectServer()
void setReconnectServer(ServerInfo server)
server
- the server to set@Deprecated String getUUID()
getUniqueId()
UUID getUniqueId()
Locale getLocale()
byte getViewDistance()
ProxiedPlayer.ChatMode getChatMode()
boolean hasChatColors()
SkinConfiguration getSkinParts()
ProxiedPlayer.MainHand getMainHand()
void setTabHeader(BaseComponent header, BaseComponent footer)
header
- The header for the tab player list, null to clear it.footer
- The footer for the tab player list, null to clear it.void setTabHeader(BaseComponent[] header, BaseComponent[] footer)
header
- The header for the tab player list, null to clear it.footer
- The footer for the tab player list, null to clear it.void resetTabHeader()
void sendTitle(Title title)
Title
to this player. This is the same as calling
Title.send(ProxiedPlayer)
.title
- The title to send to the player.Title
boolean isForgeUser()
This method is only reliable if BungeeCord links Minecraft 1.8 servers
together, as Bungee can pick up whether a user is a Forge user with the
initial handshake. If this is used for a 1.7 network, this might return
false
even if the user is a FML user, as Bungee can only
determine this information if a handshake successfully completes.
true
if it is known that the user is using a FML
client, false
otherwise.Map<String,String> getModList()
Consumers of this API should be aware that an empty mod list does
not indicate that a user is not a Forge user, and so should not
use this API to check for this. See the isForgeUser
method instead.
Calling this when handling a
ServerConnectedEvent
may be the best
place to do so as this event occurs after a FML handshake has completed,
if any has occurred.
Map
of mods, where the key is the name of the mod, and
the value is the version. Returns an empty list if the FML handshake has
not occurred for this ProxiedPlayer
yet.Scoreboard getScoreboard()
Scoreboard
that belongs to this player.Scoreboard
Copyright © 2012–2020 SpigotMC. All rights reserved.