Implement isCursed for new enchantments

By: Senmori <thesenmori@gmail.com>
This commit is contained in:
Bukkit/Spigot 2016-11-18 23:46:00 -05:00
parent 14f3943d53
commit 3b75b77e6e
2 changed files with 14 additions and 0 deletions

View File

@ -214,6 +214,15 @@ public abstract class Enchantment {
*/
public abstract boolean isTreasure();
/**
* Checks if this enchantment is a cursed enchantment
* <br>
* Cursed enchantments are found the same way treasure enchantments are
*
* @return true if the enchantment is cursed
*/
public abstract boolean isCursed();
/**
* Check if this enchantment conflicts with another enchantment.
*

View File

@ -49,6 +49,11 @@ public class EnchantmentWrapper extends Enchantment {
return getEnchantment().isTreasure();
}
@Override
public boolean isCursed() {
return getEnchantment().isCursed();
}
@Override
public boolean conflictsWith(Enchantment other) {
return getEnchantment().conflictsWith(other);