Automatic Enchantment Squared configuration.

This commit is contained in:
alexcrea 2024-06-18 16:37:16 +02:00
parent 6553122819
commit fd1fb97174
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
6 changed files with 185 additions and 5 deletions

View file

@ -107,6 +107,9 @@ class CustomAnvil : JavaPlugin() {
// temporary: handle 1.21 update
Update_1_21.handleUpdate()
// Handle custom enchant config
DependencyManager.handleConfigChanges()
// Load gui constants //TODO maybe something better later
MainConfigGui.getInstance().init(DependencyManager.packetManager)
GuiSharedConstant.loadConstants()

View file

@ -310,11 +310,9 @@ object ConfigOptions {
val enchantment = WrappedEnchantment.getByName(enchantmentName)
if(enchantment != null){
val rarity = enchantment.defaultRarity()
if(rarity != null){
return if(isFromBook) rarity.bookValue
else rarity.itemValue
}
return if(isFromBook) rarity.bookValue
else rarity.itemValue
}
return DEFAULT_ENCHANT_VALUE