mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix mis-placed processEnchantOrder from 1.18 update (#7052)
This commit is contained in:
parent
6de2d9794c
commit
f065566460
1 changed files with 6 additions and 2 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue