Use correct default. Also disable Enchantment Squared anvil listener.

This commit is contained in:
alexcrea 2024-06-16 20:58:50 +02:00
parent 88c4f0509b
commit fc033460b4
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 22 additions and 4 deletions

View file

@ -460,7 +460,7 @@ class AnvilEventListener(private val packetManager: PacketManager) : Listener {
val enchantmentMultiplier = ConfigOptions.enchantmentValue(enchantment.key, rightIsFormBook)
val value = resultLevel * enchantmentMultiplier
CustomAnvil.log("Value for ${enchantment.key.enchantmentName} level ${enchantment.value} is $value")
CustomAnvil.log("Value for ${enchantment.key.enchantmentName} level ${enchantment.value} is $value ($resultLevel * $enchantmentMultiplier)")
rightValue += value
}

View file

@ -306,6 +306,17 @@ object ConfigOptions {
if(enchantmentName == "sweeping_edge"){
return enchantmentValue("sweeping", isFromBook)
}
val enchantment = WrappedEnchantment.getByName(enchantmentName)
if(enchantment != null){
val rarity = enchantment.defaultRarity()
if(rarity != null){
return if(isFromBook) rarity.bookValue
else rarity.itemValue
}
}
return DEFAULT_ENCHANT_VALUE
}