From ee8aabbf97ceaf9719f9ea5ef09590a8287a7540 Mon Sep 17 00:00:00 2001 From: WinDanesz <31292708+WinDanesz@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:37:01 +0100 Subject: [PATCH] This might fix the lingering Frost effect (from Frost Ray) --- .../java/electroblob/wizardry/spell/FrostRay.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/electroblob/wizardry/spell/FrostRay.java b/src/main/java/electroblob/wizardry/spell/FrostRay.java index a03fcda4..a995bb7a 100644 --- a/src/main/java/electroblob/wizardry/spell/FrostRay.java +++ b/src/main/java/electroblob/wizardry/spell/FrostRay.java @@ -59,18 +59,19 @@ public class FrostRay extends SpellRay { this.getNameForTranslationFormatted()), true); // This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle // with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry. - }else if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){ + }else{ // For frost ray the entity can move slightly, unlike freeze ((EntityLivingBase)target).addPotionEffect(new PotionEffect(WizardryPotions.frost, (int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)), getProperty(EFFECT_STRENGTH).intValue())); - float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY); - if(target instanceof EntityBlaze || target instanceof EntityMagmaCube) damage *= 2; - - EntityUtils.attackEntityWithoutKnockback(target, MagicDamage.causeDirectMagicDamage(caster, - DamageType.FROST), damage); + if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){ + float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY); + if(target instanceof EntityBlaze || target instanceof EntityMagmaCube) damage *= 2; + EntityUtils.attackEntityWithoutKnockback(target, MagicDamage.causeDirectMagicDamage(caster, + DamageType.FROST), damage); + } } }