Add enchantment target for bows and crossbows

This commit is contained in:
William Blake Galbreath
2025-01-10 15:33:01 -08:00
committed by granny
parent b6e5996870
commit 2f83d9f9d6

View File

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