Make compatibility object with EcoEnchant and Enchant² use the api.

Abstract material group now have varargs "addAll" function.
This commit is contained in:
alexcrea 2024-07-08 23:24:39 +02:00
parent 1bd3328281
commit bcd8b6ae6e
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
7 changed files with 100 additions and 79 deletions

View file

@ -1,10 +1,12 @@
package xyz.alexcrea.cuanvil.dependency
import org.bukkit.Bukkit
import org.bukkit.configuration.file.FileConfiguration
import org.bukkit.plugin.Plugin
import xyz.alexcrea.cuanvil.dependency.protocolib.NoProtocoLib
import xyz.alexcrea.cuanvil.dependency.protocolib.PacketManager
import xyz.alexcrea.cuanvil.dependency.protocolib.ProtocoLibWrapper
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
import java.io.File
object DependencyManager {
@ -43,4 +45,12 @@ object DependencyManager {
}
fun writeDefaultConfig(defaultConfig: FileConfiguration, enchantment: CAEnchantment) {
defaultConfig["enchant_limits.${enchantment.key.key}"] = enchantment.defaultMaxLevel()
val rarity = enchantment.defaultRarity()
defaultConfig["enchant_values.${enchantment.key.key}.item"] = rarity.itemValue
defaultConfig["enchant_values.${enchantment.key.key}.book"] = rarity.bookValue
}
}