mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
SPIGOT-5905: Fix hex colours not being allowed in MOTD
Note: this will of course not work properly if a pre 1.16 client attempts to ping your server
This commit is contained in:
parent
d47c47ee59
commit
7560f5f5a6
@ -1,23 +1,21 @@
|
||||
--- a/net/minecraft/server/PacketStatusListener.java
|
||||
+++ b/net/minecraft/server/PacketStatusListener.java
|
||||
@@ -1,5 +1,16 @@
|
||||
@@ -1,5 +1,14 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import io.netty.channel.ChannelFutureListener;
|
||||
+import java.net.InetSocketAddress;
|
||||
+import java.util.Iterator;
|
||||
+
|
||||
+import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
+import org.bukkit.craftbukkit.util.CraftIconCache;
|
||||
+import org.bukkit.entity.Player;
|
||||
+
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class PacketStatusListener implements PacketStatusInListener {
|
||||
|
||||
private static final IChatBaseComponent a = new ChatMessage("multiplayer.status.request_handled");
|
||||
@@ -26,8 +37,96 @@
|
||||
@@ -26,8 +35,96 @@
|
||||
this.networkManager.close(PacketStatusListener.a);
|
||||
} else {
|
||||
this.d = true;
|
||||
@ -104,7 +102,7 @@
|
||||
+
|
||||
+ ServerPing ping = new ServerPing();
|
||||
+ ping.setFavicon(event.icon.value);
|
||||
+ ping.setMOTD(new ChatComponentText(event.getMotd()));
|
||||
+ ping.setMOTD(CraftChatMessage.fromString(event.getMotd())[0]);
|
||||
+ ping.setPlayerSample(playerSample);
|
||||
+ int version = SharedConstants.getGameVersion().getProtocolVersion();
|
||||
+ ping.setServerInfo(new ServerPing.ServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), version));
|
||||
|
Loading…
Reference in New Issue
Block a user