From ca95b136bed1d647726cea5eff20e42c214e4c8d Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 3 Dec 2013 22:09:14 -0500 Subject: [PATCH] Add new fishing enchants. Fixes BUKKIT-5035 By: GJ --- .../java/org/bukkit/enchantments/Enchantment.java | 10 ++++++++++ .../org/bukkit/enchantments/EnchantmentTarget.java | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/enchantments/Enchantment.java b/paper-api/src/main/java/org/bukkit/enchantments/Enchantment.java index b6cfaea0bf..61a8bca68b 100644 --- a/paper-api/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/paper-api/src/main/java/org/bukkit/enchantments/Enchantment.java @@ -120,6 +120,16 @@ public abstract class Enchantment { */ public static final Enchantment ARROW_INFINITE = new EnchantmentWrapper(51); + /** + * Decreases odds of catching worthless junk + */ + public static final Enchantment LUCK = new EnchantmentWrapper(61); + + /** + * Increases rate of fish biting your hook + */ + public static final Enchantment LURE = new EnchantmentWrapper(62); + private static final Map byId = new HashMap(); private static final Map byName = new HashMap(); private static boolean acceptingNew = true; diff --git a/paper-api/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/paper-api/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java index 4a981a4a0b..6578b36a12 100644 --- a/paper-api/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/paper-api/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java @@ -127,7 +127,6 @@ public enum EnchantmentTarget { || item.equals(Material.DIAMOND_AXE) || item.equals(Material.GOLD_AXE) || item.equals(Material.SHEARS) // NOTE: No vanilla enchantments for this - || item.equals(Material.FISHING_ROD) // NOTE: No vanilla enchantments for this || item.equals(Material.FLINT_AND_STEEL); // NOTE: No vanilla enchantments for this } }, @@ -140,6 +139,16 @@ public enum EnchantmentTarget { public boolean includes(Material item) { return item.equals(Material.BOW); } + }, + + /** + * Allows the Enchantment to be placed on fishing rods. + */ + FISHING_ROD { + @Override + public boolean includes(Material item) { + return item.equals(Material.FISHING_ROD); + } }; /**