Added Enchantment.conflictsWith() and EnchantmentTarget.includes(). Addresses BUKKIT-1159 and addresses BUKKIT-1160

This commit is contained in:
Celtic Minstrel
2012-03-12 15:33:19 -04:00
committed by EvilSeph
parent e783a03aa3
commit e8f00c8fd8
4 changed files with 140 additions and 10 deletions

View File

@@ -160,7 +160,16 @@ public abstract class Enchantment {
public abstract EnchantmentTarget getItemTarget();
/**
* Checks if this Enchantment may be applied to the given {@link ItemStack}
* Check if this enchantment conflicts with another enchantment.
*
* @param other The enchantment to check against
* @return True if there is a conflict.
*/
public abstract boolean conflictsWith(Enchantment other);
/**
* Checks if this Enchantment may be applied to the given {@link ItemStack}.
* This does not check if it conflicts with any enchantmentds already applied to the item.
*
* @param item Item to test
* @return True if the enchantment may be applied, otherwise False