Add new fishing enchants. Fixes BUKKIT-5035

By: GJ <gjmcferrin@gmail.com>
This commit is contained in:
Bukkit/Spigot 2013-12-03 22:09:14 -05:00
parent 832e4cc761
commit ca95b136be
2 changed files with 20 additions and 1 deletions

View File

@ -120,6 +120,16 @@ public abstract class Enchantment {
*/ */
public static final Enchantment ARROW_INFINITE = new EnchantmentWrapper(51); 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<Integer, Enchantment> byId = new HashMap<Integer, Enchantment>(); private static final Map<Integer, Enchantment> byId = new HashMap<Integer, Enchantment>();
private static final Map<String, Enchantment> byName = new HashMap<String, Enchantment>(); private static final Map<String, Enchantment> byName = new HashMap<String, Enchantment>();
private static boolean acceptingNew = true; private static boolean acceptingNew = true;

View File

@ -127,7 +127,6 @@ public enum EnchantmentTarget {
|| item.equals(Material.DIAMOND_AXE) || item.equals(Material.DIAMOND_AXE)
|| item.equals(Material.GOLD_AXE) || item.equals(Material.GOLD_AXE)
|| item.equals(Material.SHEARS) // NOTE: No vanilla enchantments for this || 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 || item.equals(Material.FLINT_AND_STEEL); // NOTE: No vanilla enchantments for this
} }
}, },
@ -140,6 +139,16 @@ public enum EnchantmentTarget {
public boolean includes(Material item) { public boolean includes(Material item) {
return item.equals(Material.BOW); 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);
}
}; };
/** /**