mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-27 22:38:11 +01:00
[Bleeding] Send short version string on ping. Addresses BUKKIT-5206
With the update in 1.7 that improved the server ping, it was made to include a long version string for CraftBukkit. This value is too long for proper display so we now send a shortened string consisting of the server implementation and the minecraft version.
This commit is contained in:
parent
dfcff7eabf
commit
624603cd41
2 changed files with 2 additions and 2 deletions
|
@ -899,7 +899,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
return "craftbukkit"; // CraftBukkit - cb > vanilla!
|
return server.getName(); // CraftBukkit - cb > vanilla!
|
||||||
}
|
}
|
||||||
|
|
||||||
public CrashReport b(CrashReport crashreport) {
|
public CrashReport b(CrashReport crashreport) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class PacketStatusListener implements PacketStatusInListener {
|
||||||
ping.setFavicon(event.icon.value);
|
ping.setFavicon(event.icon.value);
|
||||||
ping.setMOTD(new ChatComponentText(event.getMotd()));
|
ping.setMOTD(new ChatComponentText(event.getMotd()));
|
||||||
ping.setPlayerSample(new ServerPingPlayerSample(event.getMaxPlayers(), minecraftServer.getPlayerList().getPlayerCount()));
|
ping.setPlayerSample(new ServerPingPlayerSample(event.getMaxPlayers(), minecraftServer.getPlayerList().getPlayerCount()));
|
||||||
ping.setServerInfo(new ServerPingServerData(minecraftServer.server.getVersion(), 4)); // MAGICAL VALUE FROM MinecraftServer
|
ping.setServerInfo(new ServerPingServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), 4)); // TODO: Update when protocol changes
|
||||||
|
|
||||||
this.networkManager.handle(new PacketStatusOutServerInfo(ping), new GenericFutureListener[0]);
|
this.networkManager.handle(new PacketStatusOutServerInfo(ping), new GenericFutureListener[0]);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
Loading…
Add table
Reference in a new issue