mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user