diff options
author | Jake Potrebic <[email protected]> | 2021-12-06 12:28:36 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-06 12:28:36 -0800 |
commit | 0e25db214f2d06033cdd3a965d769c206e602bf3 (patch) | |
tree | 8542e27143ab9fded1c182a25a2efc6688d5d66b /patches/server/0065-Handle-Item-Meta-Inconsistencies.patch | |
parent | b4a77a84a7fb6280482de352874a50948ca7d33e (diff) | |
download | Paper-0e25db214f2d06033cdd3a965d769c206e602bf3.tar.gz Paper-0e25db214f2d06033cdd3a965d769c206e602bf3.zip |
Fix mis-placed processEnchantOrder from 1.18 update (#7052)
Diffstat (limited to 'patches/server/0065-Handle-Item-Meta-Inconsistencies.patch')
-rw-r--r-- | patches/server/0065-Handle-Item-Meta-Inconsistencies.patch | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch index 34a545a702..1d936562f4 100644 --- a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 566f1b8a0acd679b2f776db2e80458b1c532f97e..c39d3f15ebc8956714f963ce7ed11e0f2b2bad4f 100644 +index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc222905490d 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols; @@ -36,7 +36,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..c39d3f15ebc8956714f963ce7ed11e0f + // Paper start + private static final java.util.Comparator<? super CompoundTag> enchantSorter = java.util.Comparator.comparing(o -> o.getString("id")); -+ private void processEnchantOrder(CompoundTag tag) { ++ private void processEnchantOrder(@Nullable CompoundTag tag) { + if (tag == null || !tag.contains("Enchantments", 9)) { + return; + } @@ -54,7 +54,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..c39d3f15ebc8956714f963ce7ed11e0f public ItemStack(ItemLike item) { this(item, 1); } -@@ -195,9 +214,11 @@ public final class ItemStack { +@@ -195,6 +214,7 @@ public final class ItemStack { // CraftBukkit start - make defensive copy as this data may be coming from the save thread this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end @@ -62,7 +62,11 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..c39d3f15ebc8956714f963ce7ed11e0f this.getItem().verifyTagAfterLoad(this.tag); } -+ processEnchantOrder(this.tag); // Paper +@@ -749,6 +769,7 @@ public final class ItemStack { + + public void setTag(@Nullable CompoundTag nbt) { + this.tag = nbt; ++ this.processEnchantOrder(this.tag); // Paper if (this.getItem().canBeDepleted()) { this.setDamageValue(this.getDamageValue()); } |