Add Enchantment#isTreasure()Z

Determines if the enchantment is a treasure enchantment - only available via means other than the enchantment table.
This commit is contained in:
Senmori 2016-10-25 11:16:28 -04:00 committed by md_5
parent cdf11d5677
commit b80e520acb
2 changed files with 15 additions and 0 deletions

View file

@ -194,6 +194,16 @@ public abstract class Enchantment {
*/
public abstract EnchantmentTarget getItemTarget();
/**
* Checks if this enchantment is a treasure enchantment.
* <br>
* Treasure enchantments can only be received via looting, trading, or
* fishing.
*
* @return true if the enchantment is a treasure enchantment
*/
public abstract boolean isTreasure();
/**
* Check if this enchantment conflicts with another enchantment.
*

View file

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