mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
fix enchant limit logic issue
This commit is contained in:
parent
e4176404ac
commit
444e6354c0
1 changed files with 5 additions and 1 deletions
|
|
@ -363,8 +363,12 @@ object ConfigOptions {
|
|||
* @return The current enchantment limit. -1 if none
|
||||
*/
|
||||
private fun materialEnchantCountLimit(type: Material): Int? {
|
||||
val path = "$ENCHANT_COUNT_LIMIT_ITEMS.${type.key.key.lowercase()}"
|
||||
if(!ConfigHolder.DEFAULT_CONFIG.config.isInt(path))
|
||||
return null
|
||||
|
||||
return ConfigHolder.DEFAULT_CONFIG.config
|
||||
.getInt("$ENCHANT_COUNT_LIMIT_ITEMS.${type.key.key.lowercase()}", DEFAULT_ENCHANT_COUNT_LIMIT)
|
||||
.getInt(path)
|
||||
.takeIf { it in ENCHANT_COUNT_LIMIT_RANGE }
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue