1
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-29 23:16:06 +01:00

Add methods to check for conflicting enchantments. Adds BUKKIT-3830

By: GJ <gjmcferrin@gmail.com>
This commit is contained in:
Bukkit/Spigot 2013-03-20 01:14:02 -04:00
parent 07bdbf973d
commit 189ecfe6da
2 changed files with 16 additions and 0 deletions
paper-api/src/main/java/org/bukkit/inventory/meta

View File

@ -61,5 +61,13 @@ public interface EnchantmentStorageMeta extends ItemMeta {
*/ */
boolean removeStoredEnchant(Enchantment ench) throws IllegalArgumentException; boolean removeStoredEnchant(Enchantment ench) throws IllegalArgumentException;
/**
* Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
*
* @param ench enchantment to test
* @return true if the enchantment conflicts, false otherwise
*/
boolean hasConflictingStoredEnchant(Enchantment ench);
EnchantmentStorageMeta clone(); EnchantmentStorageMeta clone();
} }

View File

@ -107,6 +107,14 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
*/ */
boolean removeEnchant(Enchantment ench); boolean removeEnchant(Enchantment ench);
/**
* Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
*
* @param ench enchantment to test
* @return true if the enchantment conflicts, false otherwise
*/
boolean hasConflictingEnchant(Enchantment ench);
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
ItemMeta clone(); ItemMeta clone();
} }