public class ServerListPingEvent extends ServerEvent implements java.lang.Iterable<Player>
iterating
移出。Event.Result
限定符 | 构造器和说明 |
---|---|
protected |
ServerListPingEvent(java.net.InetAddress address,
java.lang.String motd,
int maxPlayers)
这个构造器用于实现提供
iterator() 方法,例如提供getNumPlayers() 玩家总数。 |
|
ServerListPingEvent(java.net.InetAddress address,
java.lang.String motd,
int numPlayers,
int maxPlayers) |
限定符和类型 | 方法和说明 |
---|---|
java.net.InetAddress |
getAddress()
获取请求来源地址。
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
int |
getMaxPlayers()
获取最大玩家数量。
|
java.lang.String |
getMotd()
获取每日信息。
|
int |
getNumPlayers()
获取玩家数量。
|
java.util.Iterator<Player> |
iterator()
调用
Iterator.remove() 方法将会强制部分玩家不会在玩家列表里显示,减小getNumPlayers() 返回的大小,并且不会再被任何一个新的迭代器返回。 |
void |
setMaxPlayers(int maxPlayers)
设置最大玩家数量。
|
void |
setMotd(java.lang.String motd)
更改每日信息。
|
void |
setServerIcon(CachedServerIcon icon)
设置发送给客户端的服务器图标。
|
getEventName, isAsynchronous
public ServerListPingEvent(java.net.InetAddress address, java.lang.String motd, int numPlayers, int maxPlayers)
protected ServerListPingEvent(java.net.InetAddress address, java.lang.String motd, int maxPlayers)
iterator()
方法,例如提供getNumPlayers()
玩家总数。
原文:
This constructor is intended for implementations that provide the
iterator()
method, thus provided the getNumPlayers()
count.
address
- 请求者的地址motd
- 每日信息maxPlayers
- 最大玩家数量public java.net.InetAddress getAddress()
原文: Get the address the ping is coming from.
public java.lang.String getMotd()
原文: Get the message of the day message.
public void setMotd(java.lang.String motd)
原文: Change the message of the day message.
motd
- 每日信息public int getNumPlayers()
原文: Get the number of players sent.
public int getMaxPlayers()
原文: Get the maximum number of players sent.
public void setMaxPlayers(int maxPlayers)
原文: Set the maximum number of players sent.
maxPlayers
- 最大玩家数量public void setServerIcon(CachedServerIcon icon) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
原文: Sets the server-icon sent to the client.
icon
- 发送给客户端的图标java.lang.IllegalArgumentException
- 如果CachedServerIcon
在这个事件中未被调用者创建则抛出错误;一些接口可能会接受nulljava.lang.UnsupportedOperationException
- 如果这个事件的调用者不支持设置这个服务器图标则抛出错误public HandlerList getHandlers()
getHandlers
在类中 Event
public static HandlerList getHandlerList()
public java.util.Iterator<Player> iterator() throws java.lang.UnsupportedOperationException
调用Iterator.remove()
方法将会强制部分玩家不会在玩家列表里显示,减小getNumPlayers()
返回的大小,并且不会再被任何一个新的迭代器返回。
原文:
Calling the Iterator.remove()
method will force that particular
player to not be displayed on the player list, decrease the size
returned by getNumPlayers()
, and will not be returned again by
any new iterator.
iterator
在接口中 java.lang.Iterable<Player>
java.lang.UnsupportedOperationException
- 如果这个事件的调用者不支持移除玩家则会抛出错误。