Add extended PaperServerListPingEvent

Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.
This commit is contained in:
Minecrell
2017-10-11 15:55:38 +02:00
parent bb5e4dd0eb
commit 2eaa723e96
4 changed files with 522 additions and 0 deletions

View File

@@ -248,9 +248,11 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
*
* @throws UnsupportedOperationException if the caller of this event does
* not support removing players
* @deprecated the Iterable interface will be removed at some point
*/
@NotNull
@Override
@Deprecated(forRemoval = true, since = "1.20.6")
public Iterator<Player> iterator() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}

View File

@@ -18,4 +18,9 @@ public interface CachedServerIcon {
@Nullable
public String getData(); // Paper
// Paper start
default boolean isEmpty() {
return getData() == null;
}
// Paper end
}