mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
fix small issue
This commit is contained in:
parent
65d6af7672
commit
d03d2a0444
1 changed files with 3 additions and 4 deletions
|
|
@ -351,7 +351,7 @@ object ConfigOptions {
|
|||
fun getEnchantCountLimit(type: Material): Int? {
|
||||
val limit = materialEnchantCountLimit(type)
|
||||
|
||||
if(limit >= 0) return limit
|
||||
if(limit != null) return limit
|
||||
if(defaultEnchantCountLimit >= 0) return defaultEnchantCountLimit
|
||||
|
||||
return DependencyManager.ecoEnchantCompatibility?.getEcoLevelLimit()
|
||||
|
|
@ -362,11 +362,10 @@ object ConfigOptions {
|
|||
*
|
||||
* @return The current enchantment limit. -1 if none
|
||||
*/
|
||||
private fun materialEnchantCountLimit(type: Material): Int {
|
||||
private fun materialEnchantCountLimit(type: Material): Int? {
|
||||
return ConfigHolder.DEFAULT_CONFIG.config
|
||||
.getInt(ENCHANT_COUNT_LIMIT_ITEMS, DEFAULT_ENCHANT_COUNT_LIMIT)
|
||||
.getInt("$ENCHANT_COUNT_LIMIT_ITEMS.${type.key.key.lowercase()}", DEFAULT_ENCHANT_COUNT_LIMIT)
|
||||
.takeIf { it in ENCHANT_COUNT_LIMIT_RANGE }
|
||||
?: DEFAULT_ENCHANT_COUNT_LIMIT
|
||||
}
|
||||
/**
|
||||
* User configured default enchantment count limit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue