mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-23 19:16:14 +01:00
b3ccf82597
In previous Minecraft versions, using WrappedServerPing.setMotD(String) behaved exactly like using Bukkit's ServerListPingEvent.setMotd(String). With the addition of RGB colors in Minecraft 1.16, Spigot's ServerListPingEvent was patched to translate the MotD string to the chat component equivalent to make it possible to use RGB colors in MotDs. In general, using raw legacy color codes (e.g. §c) within a (JSON) text component tends to cause weird issues on newer Minecraft versions, so it's better to translate them to the JSON equivalents on the server. However, the WrappedServerPing implementation in ProtocolLib was never updated with the same change, which makes it behave differently from Spigot's ServerListPingEvent now. Using ServerListPingEvent RGB color codes work, using ProtocolLib they do not work. To fix this, this commit changes WrappedServerPing.setMotD(String) to use the same method as Spigot for translating the legacy text to the JSON/chat component equivalent. This allows for example ServerListPlus to use Spigot's RGB color codes (e.g. &x&7&9&b&8&f&fHello) without requiring any changes in ServerListPlus. |
||
---|---|---|
.. | ||
main | ||
test |