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

By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
Bukkit/Spigot
2012-03-12 15:33:19 -04:00
parent 3bfc8591ab
commit 2cfe0f658a
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