3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-23 23:00:35 +01:00
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-25 11:02:20 -04:00
Ursprung d0ecc2b623
Commit 2b3503e2df

Datei anzeigen

@ -1,9 +1,11 @@
package com.velocitypowered.proxy.protocol.packet;
import com.google.common.collect.ImmutableList;
import com.velocitypowered.api.proxy.server.ServerPing;
import net.kyori.text.serializer.ComponentSerializers;
public class LegacyPingResponse {
private static final ServerPing.Players FAKE_PLAYERS = new ServerPing.Players(0, 0, ImmutableList.of());
private int protocolVersion;
private String serverVersion;
private String motd;
@ -76,7 +78,7 @@ public class LegacyPingResponse {
return new LegacyPingResponse(ping.getVersion().getProtocol(),
ping.getVersion().getName(),
ComponentSerializers.LEGACY.serialize(ping.getDescription()),
ping.getPlayers().getOnline(),
ping.getPlayers().getMax());
ping.getPlayers().orElse(FAKE_PLAYERS).getOnline(),
ping.getPlayers().orElse(FAKE_PLAYERS).getMax());
}
}