mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
add per item enchant count limit
This commit is contained in:
parent
b095cd5316
commit
65d6af7672
3 changed files with 54 additions and 4 deletions
|
|
@ -34,9 +34,8 @@ object EnchantmentUtil {
|
|||
val bypassFuse = player.hasPermission(CustomAnvil.bypassFusePermission)
|
||||
val bypassLevel = player.hasPermission(CustomAnvil.bypassLevelPermission)
|
||||
|
||||
// TODO add custom anvil maximum enchant count per item and globally too
|
||||
var maxEnchantCount = DependencyManager.ecoEnchantCompatibility?.getEcoLevelLimit()
|
||||
if(maxEnchantCount == null || maxEnchantCount < 0) maxEnchantCount = Int.MAX_VALUE;
|
||||
var maxEnchantCount = ConfigOptions.getEnchantCountLimit(item.type)
|
||||
if(maxEnchantCount == null || maxEnchantCount < 0) maxEnchantCount = Int.MAX_VALUE
|
||||
|
||||
other.forEach { (enchantment, level) ->
|
||||
if(!enchantment.isAllowed(player)) return@forEach
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue