Attempt to switch from Enchantment to WrapperEnchantment

This commit is contained in:
alexcrea 2024-06-16 03:58:18 +02:00
parent 9f74c2cfff
commit 1eac81aef6
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
12 changed files with 63 additions and 104 deletions

View file

@ -2,8 +2,8 @@ package io.delilaheve.util
import io.delilaheve.CustomAnvil
import io.delilaheve.util.EnchantmentUtil.enchantmentName
import org.bukkit.enchantments.Enchantment
import xyz.alexcrea.cuanvil.config.ConfigHolder
import xyz.alexcrea.cuanvil.enchant.WrappedEnchantment
/**
* Config option accessors
@ -239,7 +239,7 @@ object ConfigOptions {
/**
* Get the given [enchantment]'s limit
*/
fun enchantLimit(enchantment: Enchantment): Int {
fun enchantLimit(enchantment: WrappedEnchantment): Int {
return enchantLimit(enchantment.enchantmentName)
}
@ -273,7 +273,7 @@ object ConfigOptions {
* it's source [isFromBook]
*/
fun enchantmentValue(
enchantment: Enchantment,
enchantment: WrappedEnchantment,
isFromBook: Boolean
): Int {
return enchantmentValue(enchantment.enchantmentName, isFromBook)
@ -309,22 +309,4 @@ object ConfigOptions {
return DEFAULT_ENCHANT_VALUE
}
/**
* Get an array of key of basic config options
*/
fun getBasicConfigKeys(): Array<String> {
return arrayOf(
DEFAULT_LIMIT_PATH,
CAP_ANVIL_COST,
MAX_ANVIL_COST,
REPLACE_TOO_EXPENSIVE,
ITEM_REPAIR_COST,
UNIT_REPAIR_COST,
ITEM_RENAME_COST,
SACRIFICE_ILLEGAL_COST,
REMOVE_ANVIL_COST_LIMIT
)
}
}