diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt index 4b79bc86..57b2d682 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/EcoEnchant.kt @@ -241,7 +241,7 @@ abstract class EcoEnchant( return false } - if (item.type == Material.BOOK || item.type == Material.ENCHANTED_BOOK) { + if (item.type == Material.ENCHANTED_BOOK) { return true } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/EnchantingTableSupport.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/EnchantingTableSupport.kt index 42e9adaa..d1d8616f 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/EnchantingTableSupport.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/EnchantingTableSupport.kt @@ -67,8 +67,12 @@ class EnchantingTableSupport( } } + if (item.type == Material.BOOK) { + item.type = Material.ENCHANTED_BOOK + } + var multiplier = 0.01 - if (item.type == Material.BOOK || item.type == Material.ENCHANTED_BOOK) { + if (item.type == Material.ENCHANTED_BOOK) { multiplier *= plugin.configYml.getDouble("enchanting-table.book-multiplier") } @@ -163,7 +167,8 @@ class EnchantingTableSupport( val levelScale = ceil(maxObtainableLevel / 30.0).toInt() - val bottomEnchantLevel = (ceil((baseLevel / 3).coerceAtLeast(1.0)).toInt() * levelScale).coerceAtMost(maxObtainableLevel) + val bottomEnchantLevel = + (ceil((baseLevel / 3).coerceAtLeast(1.0)).toInt() * levelScale).coerceAtMost(maxObtainableLevel) val midEnchantLevel = ((baseLevel * 2 / 3).toInt() + 1) * levelScale val topEnchantLevel = baseLevel.coerceAtLeast(bonus * 2.0).toInt() * levelScale diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/LootSupport.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/LootSupport.kt index 727f0fb1..5fb918b8 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/LootSupport.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/LootSupport.kt @@ -38,7 +38,7 @@ class LootSupport( var multiplier = 0.01 - if (item.type == Material.BOOK || item.type == Material.ENCHANTED_BOOK) { + if (item.type == Material.ENCHANTED_BOOK) { multiplier *= plugin.configYml.getDouble("loot.book-multiplier") } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/VillagerSupport.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/VillagerSupport.kt index cfc282d4..2dc3d5ce 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/VillagerSupport.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/mechanics/VillagerSupport.kt @@ -35,7 +35,7 @@ class VillagerSupport( var multiplier = 0.01 - if (result.type == Material.BOOK || result.type == Material.ENCHANTED_BOOK) { + if (result.type == Material.ENCHANTED_BOOK) { multiplier *= plugin.configYml.getDouble("villager.book-multiplier") }