mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Config to allow unsafe enchants
This commit is contained in:
@@ -27,3 +27,16 @@
|
||||
public int getDamageValue() {
|
||||
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, Integer.valueOf(0)), 0, this.getMaxDamage());
|
||||
}
|
||||
@@ -1232,6 +_,12 @@
|
||||
public boolean isEnchanted() {
|
||||
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
|
||||
}
|
||||
+
|
||||
+ // Purpur start - Config to allow unsafe enchants
|
||||
+ public boolean hasEnchantment(Holder<Enchantment> enchantment) {
|
||||
+ return this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).getLevel(enchantment) > 0;
|
||||
+ }
|
||||
+ // Purpur end - Config to allow unsafe enchants
|
||||
|
||||
public ItemEnchantments getEnchantments() {
|
||||
return this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY);
|
||||
|
||||
Reference in New Issue
Block a user