Fix CME in remove curse

This commit is contained in:
Electroblob77
2020-09-06 18:23:41 +01:00
parent 373ab0c3dc
commit 472727552e
@@ -8,6 +8,8 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.ArrayList;
public class RemoveCurse extends SpellBuff { public class RemoveCurse extends SpellBuff {
public RemoveCurse(){ public RemoveCurse(){
@@ -22,7 +24,7 @@ public class RemoveCurse extends SpellBuff {
boolean flag = false; boolean flag = false;
for(PotionEffect effect : caster.getActivePotionEffects()){ for(PotionEffect effect : new ArrayList<>(caster.getActivePotionEffects())){ // Get outta here, CMEs
// The PotionEffect version (as opposed to Potion) does not call cleanup callbacks // The PotionEffect version (as opposed to Potion) does not call cleanup callbacks
if(effect.getPotion() instanceof Curse){ if(effect.getPotion() instanceof Curse){
caster.removePotionEffect(effect.getPotion()); caster.removePotionEffect(effect.getPotion());