mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 22:52:13 -07:00
fix more compile issues
This commit is contained in:
@@ -44,9 +44,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ private net.minecraft.nbt.StringTag convert(String json) {
|
||||
+ Component component = Component.Serializer.fromJson(json);
|
||||
+ if (component.getContents() instanceof net.minecraft.network.chat.contents.LiteralContents literalContents && literalContents.text().contains("\u00A7") && component.getSiblings().isEmpty()) {
|
||||
+ if (component.getContents() instanceof final net.minecraft.network.chat.contents.PlainTextContents plainTextContents && plainTextContents.text().contains("\u00A7") && component.getSiblings().isEmpty()) {
|
||||
+ // Only convert if the root component is a single comp with legacy in it, don't convert already normal components
|
||||
+ component = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(literalContents.text())[0];
|
||||
+ component = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(plainTextContents.text())[0];
|
||||
+ }
|
||||
+ return net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(component));
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user