Update to 1.18.1 (#7076)

This commit is contained in:
Nassim Jahnke 2021-12-10 15:24:07 +01:00 committed by GitHub
parent dce79f333c
commit 1c779c2d2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
146 changed files with 568 additions and 588 deletions

View file

@ -5,10 +5,10 @@ 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 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892dfce017c70 100644
index 83d872044c3db54352847e08bb333ff7e0aee0b0..6dd68c17d5365fecfbd15cfaac837e0869cdce2e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -169,6 +169,44 @@ public final class ItemStack {
@@ -168,6 +168,44 @@ public final class ItemStack {
list.sort((Comparator<? super net.minecraft.nbt.Tag>) enchantSorter); // Paper
} catch (Exception ignored) {}
}
@ -21,7 +21,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
+ if (json != null && json.contains("\u00A7")) {
+ try {
+ display.put("Name", convert(json));
+ } catch (JsonParseException jsonparseexception) {
+ } catch (com.google.gson.JsonParseException jsonparseexception) {
+ display.remove("Name");
+ }
+ }
@ -33,7 +33,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
+ if (json != null && json.contains("\u00A7")) { // Only try if it has legacy in the unparsed json
+ try {
+ list.set(index, convert(json));
+ } catch (JsonParseException e) {
+ } catch (com.google.gson.JsonParseException e) {
+ list.set(index, net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(new TextComponent(""))));
+ }
+ }
@ -53,7 +53,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
// Paper end
public ItemStack(ItemLike item) {
@@ -215,6 +253,7 @@ public final class ItemStack {
@@ -214,6 +252,7 @@ public final class ItemStack {
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
this.processEnchantOrder(this.tag); // Paper