Added randomenchant bypasshardcap permission

This commit is contained in:
Auxilor 2021-02-06 17:19:02 +00:00
parent df7c2d23c9
commit 1f2f56f0bd
2 changed files with 9 additions and 0 deletions

View File

@ -67,6 +67,11 @@ public class CommandRandomenchant extends AbstractCommand {
}
}
}
if (this.getPlugin().getConfigYml().getBool("anvil.hard-cap.enabled")
&& !player.hasPermission("ecoenchants.randomenchant.bypasshardcap")
&& onItem.size() >= this.getPlugin().getConfigYml().getInt("anvil.hard-cap.cap")) {
conflicts = true;
}
if (!conflicts) {
enchant = ecoEnchant;
}

View File

@ -48,6 +48,7 @@ permissions:
ecoenchants.enchantinfo: true
ecoenchants.ecodebug: true
ecoenchants.randomenchant: true
ecoenchants.randomenchant.bypasshardcap: true
ecoenchants.anvil.*: true
ecoenchants.anvil.*:
description: Allows all anvil permissions
@ -74,6 +75,9 @@ permissions:
ecoenchants.randomenchant:
description: Allows the use of /randomenchant to apply a random enchantment to an item
default: op
ecoenchants.randomenchant.bypasshardcap:
description: Allows /randomenchant bypassing the anvil hard cap
default: op
ecoenchants.anvil.bypasshardcap:
description: Allows bypassing the anvil hard cap
default: op