Fix mis-placed processEnchantOrder from 1.18 update (#7052)

This commit is contained in:
Jake Potrebic 2021-12-06 12:28:36 -08:00
parent 6de2d9794c
commit f065566460

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
+ private static final java.util.Comparator<? super CompoundTag> enchantSorter = java.util.Comparator.comparing(o -> o.getString("id")); + 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)) { + if (tag == null || !tag.contains("Enchantments", 9)) {
+ return; + return;
+ } + }
@ -62,7 +62,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.getItem().verifyTagAfterLoad(this.tag); this.getItem().verifyTagAfterLoad(this.tag);
} }
+ processEnchantOrder(this.tag); // Paper @@ -0,0 +0,0 @@ public final class ItemStack {
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
+ this.processEnchantOrder(this.tag); // Paper
if (this.getItem().canBeDepleted()) { if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue()); this.setDamageValue(this.getDamageValue());
} }