From 01dba3419dcc6e3f6ffc3afe481c0a72a587fb93 Mon Sep 17 00:00:00 2001 From: "yrsegal@gmail.com" Date: Mon, 6 Jun 2022 21:10:20 -0400 Subject: [PATCH] fix potion effects being able to go into the weird negative range --- .../common/casting/operators/spells/OpPotionEffect.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt index 5306bdde..0e305be6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt @@ -1,10 +1,6 @@ package at.petrak.hexcasting.common.casting.operators.spells -import at.petrak.hexcasting.api.spell.getChecked -import at.petrak.hexcasting.api.spell.ParticleSpray -import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.SpellDatum -import at.petrak.hexcasting.api.spell.SpellOperator +import at.petrak.hexcasting.api.spell.* import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapInvalidIota import net.minecraft.world.effect.MobEffect @@ -33,7 +29,7 @@ class OpPotionEffect( val duration = max(args.getChecked(1, argc), 0.0) ctx.assertEntityInRange(target) val potency = if (this.allowPotency) - max(args.getChecked(2, argc), 1.0) + args.getChecked(2, argc).coerceIn(1.0, 128.0) else 1.0 val cost = this.baseCost * duration * if (potencyCubic) {