[ci skip] rebuild patches

This commit is contained in:
Jake Potrebic
2023-03-23 14:57:03 -07:00
parent 39255145b6
commit 0adc18baf8
60 changed files with 1113 additions and 1197 deletions

View File

@@ -130,14 +130,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- ListTag list = CraftItemStack.getEnchantmentList(this.handle), listCopy;
- if (list == null) {
- return 0;
+ // Paper start - replace entire method
+ int level = getEnchantmentLevel(ench);
+ if (level > 0) {
+ final ItemMeta itemMeta = this.getItemMeta();
+ if (itemMeta == null) return 0;
+ itemMeta.removeEnchant(ench);
+ this.setItemMeta(itemMeta);
}
- }
- int index = Integer.MIN_VALUE;
- int level = Integer.MIN_VALUE;
- int size = list.size();
@@ -169,7 +162,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (i != index) {
- listCopy.add(list.get(i));
- }
- }
+ // Paper start - replace entire method
+ int level = getEnchantmentLevel(ench);
+ if (level > 0) {
+ final ItemMeta itemMeta = this.getItemMeta();
+ if (itemMeta == null) return 0;
+ itemMeta.removeEnchant(ench);
+ this.setItemMeta(itemMeta);
}
- this.handle.getTag().put(ENCHANTMENTS.NBT, listCopy);
+ // Paper end