Parse MOTD as legacy sectioned string (Fixes #8036)

This is not ideal but this is how MOTDs have been parsed for years,
ensure that this is performed for all things getting the MOTD from
the server
This commit is contained in:
Shane Freeder 2022-06-22 09:15:20 +01:00
parent 4c9317c9fb
commit 147a2b7f54
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
1 changed files with 2 additions and 2 deletions

View File

@ -1839,7 +1839,7 @@ index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c18
} }
collection = icons; collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a888631dc866a784def3e59cd6cc644905f866b3..5251b5d91f4b7d8afc5dc8cf6cbb2820a29594e9 100644 index a888631dc866a784def3e59cd6cc644905f866b3..9bd413eb9700d33384f2806e957d42613bd6f0f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -588,8 +588,10 @@ public final class CraftServer implements Server { @@ -588,8 +588,10 @@ public final class CraftServer implements Server {
@ -1958,7 +1958,7 @@ index a888631dc866a784def3e59cd6cc644905f866b3..5251b5d91f4b7d8afc5dc8cf6cbb2820
+ // Paper start + // Paper start
+ @Override + @Override
+ public net.kyori.adventure.text.Component motd() { + public net.kyori.adventure.text.Component motd() {
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(net.minecraft.network.chat.Component.literal(console.getMotd())); + return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(console.getMotd());
+ } + }
+ // Paper end + // Paper end
@Override @Override