Shears can have looting enchantment

This commit is contained in:
BillyGalbreath
2025-01-12 14:28:09 -08:00
committed by granny
parent d01b838fb6
commit 9cf9db1dbd
2 changed files with 13 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
@@ -227,6 +_,18 @@
@@ -227,6 +_,30 @@
public boolean includes(@NotNull Material item) {
return BREAKABLE.includes(item) || (WEARABLE.includes(item) && !item.equals(Material.ELYTRA)) || item.equals(Material.COMPASS);
}
@@ -16,6 +16,18 @@
+ return item.equals(Material.BOW) || item.equals(Material.CROSSBOW);
+ }
+ // Purpur end - Add enchantment target for bows and crossbows
+ // Purpur start - Shears can have looting enchantment
+ },
+
+ /**
+ * Allow the Enchantment to be placed on shears.
+ */
+ WEAPON_AND_SHEARS {
+ @Override
+ public boolean includes(@NotNull Material item) {
+ return WEAPON.includes(item) || item.equals(Material.SHEARS);
+ }
+ // Purpur end - Shears can have looting enchantment
};
/**