fix possible errors when mending is unsafely enchanted on something it wasn't supposed to be enchanted on

This commit is contained in:
2025-05-23 17:43:21 +02:00
parent 3f742c7145
commit f0a4c3ff6b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>me.youhavetrouble</groupId>
<artifactId>MendingBeGone</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<packaging>jar</packaging>
<name>MendingBeGone</name>
@@ -75,7 +75,7 @@ public final class MendingBeGone extends JavaPlugin implements Listener {
itemStack.removeEnchantment(Enchantment.MENDING);
if (itemStack.containsEnchantment(Enchantment.DURABILITY))
itemStack.removeEnchantment(Enchantment.DURABILITY);
itemStack.addEnchantment(Enchantment.DURABILITY, 3);
itemStack.addUnsafeEnchantment(Enchantment.DURABILITY, 3);
}
if (!Material.ENCHANTED_BOOK.equals(itemStack.getType())) return;
ItemMeta meta = itemStack.getItemMeta();