Fixed high level bias
This commit is contained in:
@@ -134,8 +134,8 @@ class EnchantingTableSupport(
|
|||||||
cost / maxObtainableLevel.toDouble()
|
cost / maxObtainableLevel.toDouble()
|
||||||
}
|
}
|
||||||
|
|
||||||
val levelPart2 = NumberUtils.bias(levelPart1, enchantment.type.highLevelBias)
|
val levelPart2 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart1)
|
||||||
val levelPart3 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart2)
|
val levelPart3 = NumberUtils.bias(levelPart2, enchantment.type.highLevelBias)
|
||||||
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
||||||
|
|
||||||
multiplier /= this.plugin.configYml.getDouble("enchanting-table.reduction")
|
multiplier /= this.plugin.configYml.getDouble("enchanting-table.reduction")
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ class VillagerSupport(
|
|||||||
val maxLevel = enchantment.maximumLevel
|
val maxLevel = enchantment.maximumLevel
|
||||||
|
|
||||||
val levelPart1 = event.recipe.ingredients[0].amount / 64.0
|
val levelPart1 = event.recipe.ingredients[0].amount / 64.0
|
||||||
val levelPart2 = NumberUtils.bias(levelPart1, enchantment.type.highLevelBias)
|
val levelPart2 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart1)
|
||||||
val levelPart3 = NumberUtils.triangularDistribution(0.0, 1.0, levelPart2)
|
val levelPart3 = NumberUtils.bias(levelPart2, enchantment.type.highLevelBias)
|
||||||
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
val level = ceil(levelPart3 * maxLevel).coerceIn(1.0..maxLevel.toDouble()).toInt()
|
||||||
|
|
||||||
multiplier /= this.plugin.configYml.getDouble("villager.reduction")
|
multiplier /= this.plugin.configYml.getDouble("villager.reduction")
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class EnchantmentType(
|
|||||||
val id = config.getString("id")
|
val id = config.getString("id")
|
||||||
val format = config.getString("format")
|
val format = config.getString("format")
|
||||||
val limit = config.getInt("limit").infiniteIfNegative()
|
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")
|
val noGrindstone = config.getBool("no-grindstone")
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user