Fix CME in remove curse
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user