Closed WobbyChip closed 1 year ago
I think I found the issue, I am not sure, but I assume if modifier.multiplier
is the chance passed in the yml, then this makes sense, since chance *= (100 - 99)
will still be 100, when chance *= (100 - 100)
will be 0. And in this case, a chance for a rocket to not be consumed must be below 100: NumberUtils.randFloat(0.0, 100.0) > chance
.
EffectElytraBoostSaveChance.kt
fun handle(event: PlayerElytraBoostEvent) {
if (McmmoManager.isFake(event)) {
return
}
val player = event.player
var chance = 100.0
for (modifier in (modifiers[player.uniqueId] ?: emptyList())) {
chance *= (100 - modifier.multiplier)
}
if (NumberUtils.randFloat(0.0, 100.0) > chance) {
event.setShouldConsume(false)
}
}
fixed in EffectElytraBoostSaveChance.kt
Describe the bug Effect elytra_boost_save_chance chance only works with 100%, otherwise, fireworks will be consumed always.
To Reproduce
Expected behavior Fireworks should not be consumed always when the percentage is below 100%.
Server Information (please complete the following information):