Fix hex colours not being allowed in MOTD (#3755)

This commit is contained in:
Callum
2020-07-02 08:19:43 +01:00
parent eaeac03650
commit 85408c2f74

View File

@@ -71,11 +71,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects;
+import com.google.common.base.Strings; +import com.google.common.base.Strings;
+import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfile;
+import net.minecraft.server.ChatComponentText;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.NetworkManager; +import net.minecraft.server.NetworkManager;
+import net.minecraft.server.PacketStatusOutServerInfo; +import net.minecraft.server.PacketStatusOutServerInfo;
+import net.minecraft.server.ServerPing; +import net.minecraft.server.ServerPing;
+import org.bukkit.craftbukkit.util.CraftChatMessage;
+ +
+import java.util.List; +import java.util.List;
+import java.util.UUID; +import java.util.UUID;
@@ -155,7 +155,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ServerPing ping = new ServerPing(); + ServerPing ping = new ServerPing();
+ +
+ // Description + // Description
+ ping.setMOTD(new ChatComponentText(event.getMotd())); + ping.setMOTD(CraftChatMessage.fromString(event.getMotd())[0]);
+ +
+ // Players + // Players
+ if (!event.shouldHidePlayers()) { + if (!event.shouldHidePlayers()) {