public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
iterating
over this event.Event.Result
Modifier | Constructor and Description |
---|---|
protected |
ServerListPingEvent(@NotNull InetAddress address,
net.kyori.adventure.text.Component motd,
int maxPlayers)
This constructor is intended for implementations that provide the
iterator() method, thus provided the getNumPlayers()
count. |
|
ServerListPingEvent(@NotNull InetAddress address,
net.kyori.adventure.text.Component motd,
int numPlayers,
int maxPlayers) |
protected |
ServerListPingEvent(@NotNull InetAddress address,
@NotNull String motd,
int maxPlayers)
Deprecated.
|
|
ServerListPingEvent(@NotNull InetAddress address,
@NotNull String motd,
int numPlayers,
int maxPlayers)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
@NotNull InetAddress |
getAddress()
Get the address the ping is coming from.
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
int |
getMaxPlayers()
Get the maximum number of players sent.
|
@NotNull String |
getMotd()
Deprecated.
in favour of
motd() |
int |
getNumPlayers()
Get the number of players sent.
|
@NotNull Iterator<Player> |
iterator() |
net.kyori.adventure.text.Component |
motd()
Get the message of the day message.
|
void |
motd(net.kyori.adventure.text.Component motd)
Change the message of the day message.
|
void |
setMaxPlayers(int maxPlayers)
Set the maximum number of players sent.
|
void |
setMotd(@NotNull String motd)
Deprecated.
in favour of
motd(net.kyori.adventure.text.Component) |
void |
setServerIcon(CachedServerIcon icon)
Sets the server-icon sent to the client.
|
callEvent, getEventName, isAsynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
@Deprecated public ServerListPingEvent(@NotNull @NotNull InetAddress address, @NotNull @NotNull String motd, int numPlayers, int maxPlayers)
@Deprecated protected ServerListPingEvent(@NotNull @NotNull InetAddress address, @NotNull @NotNull String motd, int maxPlayers)
ServerListPingEvent(java.net.InetAddress, net.kyori.adventure.text.Component, int)
iterator()
method, thus provided the getNumPlayers()
count.address
- the address of the pingermotd
- the message of the daymaxPlayers
- the max number of playerspublic ServerListPingEvent(@NotNull @NotNull InetAddress address, @NotNull net.kyori.adventure.text.Component motd, int numPlayers, int maxPlayers)
protected ServerListPingEvent(@NotNull @NotNull InetAddress address, @NotNull net.kyori.adventure.text.Component motd, int maxPlayers)
iterator()
method, thus provided the getNumPlayers()
count.address
- the address of the pingermotd
- the message of the daymaxPlayers
- the max number of players@NotNull public net.kyori.adventure.text.Component motd()
public void motd(@NotNull net.kyori.adventure.text.Component motd)
motd
- the message of the day@NotNull public @NotNull InetAddress getAddress()
@NotNull @Deprecated public @NotNull String getMotd()
motd()
@Deprecated public void setMotd(@NotNull @NotNull String motd)
motd(net.kyori.adventure.text.Component)
motd
- the message of the daypublic int getNumPlayers()
public int getMaxPlayers()
public void setMaxPlayers(int maxPlayers)
maxPlayers
- the maximum number of playerpublic void setServerIcon(CachedServerIcon icon) throws IllegalArgumentException, UnsupportedOperationException
icon
- the icon to send to the clientIllegalArgumentException
- if the CachedServerIcon
is not
created by the caller of this event; null may be accepted for some
implementationsUnsupportedOperationException
- if the caller of this event does
not support setting the server icon@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
@NotNull public @NotNull Iterator<Player> iterator() throws UnsupportedOperationException
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
in interface Iterable<Player>
UnsupportedOperationException
- if the caller of this event does
not support removing playersCopyright © 2021. All rights reserved.