mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Add Enchantment#isTreasure()Z
Determines if the enchantment is a treasure enchantment - only available via means other than the enchantment table. By: Senmori <thesenmori@gmail.com>
This commit is contained in:
parent
a05a1330d3
commit
bde8f61893
2 changed files with 15 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue