mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Fixed books being enchanted
This commit is contained in:
parent
0ec4385a29
commit
991004236d
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user