fix more compile issues
This commit is contained in:
parent
0dee538a62
commit
a364b7e88b
21 changed files with 34 additions and 40 deletions
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Update itemstack legacy name and lore
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 19e8d10727fc4838cd8261dfec92f3828ea5b09f..b5080861a4aa34a95618bcee7723bd3ec34b09c4 100644
|
||||
index 19e8d10727fc4838cd8261dfec92f3828ea5b09f..e9df7ea1228603ee3ebf515b6419f668cbe3aef7 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -195,6 +195,44 @@ public final class ItemStack {
|
||||
|
|
@ -44,9 +44,9 @@ index 19e8d10727fc4838cd8261dfec92f3828ea5b09f..b5080861a4aa34a95618bcee7723bd3e
|
|||
+
|
||||
+ 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));
|
||||
+ }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue