public class PingReply
extends java.lang.Object
Constructor and Description |
---|
PingReply(java.lang.Object ctx,
java.lang.String motd,
int onlinePlayers,
int maxPlayers,
int protocolVersion,
java.lang.String protocolName,
java.util.List<java.lang.String> playerSample)
Creates a class to store data that will be sent to the client in a PacketStatusOutServerInfo packet
|
Modifier and Type | Method and Description |
---|---|
org.bukkit.util.CachedServerIcon |
getIcon()
Returns the server's icon that is to be sent to the client
|
int |
getMaxPlayers()
Returns the maximum amount of players to be sent to the client
|
java.lang.String |
getMOTD()
Returns the MOTD to be sent to the client
|
int |
getOnlinePlayers()
Returns the amount of online players to be sent to the client
|
java.util.List<java.lang.String> |
getPlayerSample()
Returns a list of player names to be sent to the client
|
java.lang.String |
getProtocolName()
Returns the protocol name to be sent to the client
|
int |
getProtocolVersion()
Returns the protocol version to be sent to the client
|
void |
hidePlayerSample(boolean hidePlayerSample)
Sets whether the player sample should be hidden
|
boolean |
isPlayerSampleHidden()
Returns whether the player sample is to be hidden
|
void |
setIcon(org.bukkit.util.CachedServerIcon icon)
Sets the icon to be sent to the client
|
void |
setMaxPlayers(int maxPlayers)
Sets the maximum amount of players to be sent to the client
|
void |
setMOTD(java.lang.String motd)
Sets the MOTD to be sent to the client
|
void |
setOnlinePlayers(int onlinePlayers)
Sets the amount of online players to be sent to the client
|
void |
setPlayerSample(java.util.List<java.lang.String> playerSample)
Sets the list of player names that will be sent to the client
Note that if the player sample is hidden this list will not be sent
|
void |
setProtocolName(java.lang.String protocolName)
Sets the protocol name to be sent to the client
|
void |
setProtocolVersion(int protocolVersion)
Sets the protocol version to be sent to the client
|
public PingReply(java.lang.Object ctx, java.lang.String motd, int onlinePlayers, int maxPlayers, int protocolVersion, java.lang.String protocolName, java.util.List<java.lang.String> playerSample)
ctx
- The ChannelHandlerContext instancemotd
- The MOTDonlinePlayers
- The amount of online playersmaxPlayers
- The maximum amount of playersprotocolVersion
- The protocol versionprotocolName
- The name of the protocolplayerSample
- A list of player namespublic int getOnlinePlayers()
public int getMaxPlayers()
public java.lang.String getMOTD()
public int getProtocolVersion()
public java.lang.String getProtocolName()
public java.util.List<java.lang.String> getPlayerSample()
public boolean isPlayerSampleHidden()
public org.bukkit.util.CachedServerIcon getIcon()
public void setOnlinePlayers(int onlinePlayers)
onlinePlayers
- Amount of online playerspublic void setMaxPlayers(int maxPlayers)
maxPlayers
- Amount of maximum playerspublic void setMOTD(java.lang.String motd)
motd
- The MOTDpublic void setProtocolVersion(int protocolVersion)
protocolVersion
- The protocol versionpublic void setProtocolName(java.lang.String protocolName)
protocolName
- The protocol's namepublic void setPlayerSample(java.util.List<java.lang.String> playerSample)
playerSample
- New list of player namespublic void hidePlayerSample(boolean hidePlayerSample)
hidePlayerSample
- A booleanpublic void setIcon(org.bukkit.util.CachedServerIcon icon)
icon
- The icon