mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-21 14:55:17 +01:00
Fixed high level bias
This commit is contained in:
parent
0da40cab00
commit
c4b71948df
@ -134,8 +134,8 @@ class EnchantingTableSupport(
|
||||
cost / maxObtainableLevel.toDouble()
|
||||
}
|
||||
|
||||
val levelPart2 = NumberUtils.bias(levelPart1, enchantment.type.highLevelBias)
|
||||
val levelPart3 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart2)
|
||||
val levelPart2 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart1)
|
||||
val levelPart3 = NumberUtils.bias(levelPart2, enchantment.type.highLevelBias)
|
||||
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
||||
|
||||
multiplier /= this.plugin.configYml.getDouble("enchanting-table.reduction")
|
||||
|
@ -76,8 +76,8 @@ class VillagerSupport(
|
||||
val maxLevel = enchantment.maximumLevel
|
||||
|
||||
val levelPart1 = event.recipe.ingredients[0].amount / 64.0
|
||||
val levelPart2 = NumberUtils.bias(levelPart1, enchantment.type.highLevelBias)
|
||||
val levelPart3 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart2)
|
||||
val levelPart2 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart1)
|
||||
val levelPart3 = NumberUtils.bias(levelPart2, enchantment.type.highLevelBias)
|
||||
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
||||
|
||||
multiplier /= this.plugin.configYml.getDouble("villager.reduction")
|
||||
|
@ -15,7 +15,7 @@ class EnchantmentType(
|
||||
val id = config.getString("id")
|
||||
val format = config.getString("format")
|
||||
val limit = config.getInt("limit").infiniteIfNegative()
|
||||
val highLevelBias = config.getDouble("high-level-bias")
|
||||
val highLevelBias = config.getDouble("high-level-bias").coerceAtMost(0.999)
|
||||
val noGrindstone = config.getBool("no-grindstone")
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user