diff --git a/paper-server/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch b/paper-server/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch index d9deac6c49..dbdd41937d 100644 --- a/paper-server/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch +++ b/paper-server/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch @@ -4,7 +4,7 @@ MinecraftServer minecraftserver = this.serverConnectionListener.getServer(); int i = bytebuf.readableBytes(); String s; -+ org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit ++ org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.previewsChat(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit switch (i) { case 0: diff --git a/paper-server/nms-patches/net/minecraft/server/network/PacketStatusListener.patch b/paper-server/nms-patches/net/minecraft/server/network/PacketStatusListener.patch index 5d113f281c..1e4f173157 100644 --- a/paper-server/nms-patches/net/minecraft/server/network/PacketStatusListener.patch +++ b/paper-server/nms-patches/net/minecraft/server/network/PacketStatusListener.patch @@ -19,7 +19,7 @@ public class PacketStatusListener implements PacketStatusInListener { private static final IChatBaseComponent DISCONNECT_REASON = IChatBaseComponent.translatable("multiplayer.status.request_handled"); -@@ -35,7 +47,102 @@ +@@ -35,7 +47,103 @@ this.connection.disconnect(PacketStatusListener.DISCONNECT_REASON); } else { this.hasRequestedStatus = true; @@ -32,7 +32,7 @@ + CraftIconCache icon = server.server.getServerIcon(); + + ServerListPingEvent() { -+ super(((InetSocketAddress) connection.getRemoteAddress()).getAddress(), server.getMotd(), server.getPlayerList().getMaxPlayers()); ++ super(((InetSocketAddress) connection.getRemoteAddress()).getAddress(), server.getMotd(), server.previewsChat(), server.getPlayerList().getMaxPlayers()); + } + + @Override @@ -112,6 +112,7 @@ + } + + ServerPing ping = new ServerPing(); ++ ping.setPreviewsChat(event.shouldSendChatPreviews()); + ping.setFavicon(event.icon.value); + ping.setDescription(CraftChatMessage.fromString(event.getMotd(), true)[0]); + ping.setPlayers(playerSample); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index d59137ad1d..66a521110a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -834,8 +834,8 @@ public class CraftEventFactory { /** * Server methods */ - public static ServerListPingEvent callServerListPingEvent(Server craftServer, InetAddress address, String motd, int numPlayers, int maxPlayers) { - ServerListPingEvent event = new ServerListPingEvent(address, motd, numPlayers, maxPlayers); + public static ServerListPingEvent callServerListPingEvent(Server craftServer, InetAddress address, String motd, boolean shouldSendChatPreviews, int numPlayers, int maxPlayers) { + ServerListPingEvent event = new ServerListPingEvent(address, motd, shouldSendChatPreviews, numPlayers, maxPlayers); craftServer.getPluginManager().callEvent(event); return event; }