From ad9f482e7640e8f7c2b214ee6e9cabd7f6960064 Mon Sep 17 00:00:00 2001 From: WinDanesz <31292708+WinDanesz@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:55:09 +0200 Subject: [PATCH] fix: Fixed a bug that prevented NPCs (wizards) from casting certain buff spells --- src/main/java/electroblob/wizardry/spell/SpellBuff.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/spell/SpellBuff.java b/src/main/java/electroblob/wizardry/spell/SpellBuff.java index 30fb464e..b767a6f2 100644 --- a/src/main/java/electroblob/wizardry/spell/SpellBuff.java +++ b/src/main/java/electroblob/wizardry/spell/SpellBuff.java @@ -125,7 +125,8 @@ public class SpellBuff extends Spell { @Override public boolean cast(World world, EntityLiving caster, EnumHand hand, int ticksInUse, EntityLivingBase target, SpellModifiers modifiers){ // Wizards can only cast a buff spell if they don't already have its effects. - if(caster.getActivePotionMap().keySet().containsAll(potionSet)) return false; + // Some buff spells doesn't add any potion effects, those are ignored by this check + if(!potionSet.isEmpty() && caster.getActivePotionMap().keySet().containsAll(potionSet)) return false; // Only return on the server side or the client probably won't spawn particles if(!this.applyEffects(caster, modifiers) && !world.isRemote) return false; if(world.isRemote) this.spawnParticles(world, caster, modifiers);