diff --git a/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java b/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java index 67453e0531..6b08d87641 100644 --- a/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java +++ b/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java @@ -66,11 +66,11 @@ class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl { @Override public List getNetMana(Game game) { - netMana.clear(); + ArrayList netManaCopy = new ArrayList<>(); if (game != null) { - netMana.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this)); + netManaCopy.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this)); } - return netMana; + return netManaCopy; } } diff --git a/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java b/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java index 054f315936..44ad62ff23 100644 --- a/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java @@ -1,6 +1,6 @@ - package mage.abilities.mana; +import java.util.ArrayList; import java.util.List; import java.util.UUID; import mage.Mana; @@ -42,6 +42,7 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl @Override public List getNetMana(Game game) { + List netManas = new ArrayList<>(); if (netMana.isEmpty() && game != null) { Player controller = game.getPlayer(getControllerId()); if (controller != null) { @@ -68,7 +69,8 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl } } } - return netMana; + netManas.addAll(netMana); + return netManas; } @Override diff --git a/Mage/src/main/java/mage/abilities/mana/ConditionalManaAbility.java b/Mage/src/main/java/mage/abilities/mana/ConditionalManaAbility.java index 06c2919d17..c2d0a97511 100644 --- a/Mage/src/main/java/mage/abilities/mana/ConditionalManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/ConditionalManaAbility.java @@ -33,8 +33,6 @@ public class ConditionalManaAbility extends ActivatedManaAbilityImpl { @Override public List getNetMana(Game game) { - List newNetMana = new ArrayList<>(); - newNetMana.addAll(conditionalManaEffect.getNetMana(game, this)); - return newNetMana; + return new ArrayList<>(conditionalManaEffect.getNetMana(game, this)); } } diff --git a/Mage/src/main/java/mage/abilities/mana/ManaOptions.java b/Mage/src/main/java/mage/abilities/mana/ManaOptions.java index 6633be31e8..81792fc8c9 100644 --- a/Mage/src/main/java/mage/abilities/mana/ManaOptions.java +++ b/Mage/src/main/java/mage/abilities/mana/ManaOptions.java @@ -53,7 +53,7 @@ public class ManaOptions extends ArrayList { boolean hasTapCost = hasTapCost(abilities.get(0)); for (Mana netMana : netManas) { for (Mana mana : copy) { - if (!hasTapCost || checkTappedForManaReplacement(abilities.get(0), game, netMana)) { + if (!hasTapCost /* || checkTappedForManaReplacement(abilities.get(0), game, netMana) */) { // Seems to produce endless iterations so deactivated for now: https://github.com/magefree/mage/issues/5023 Mana newMana = new Mana(); newMana.add(mana); newMana.add(netMana); diff --git a/Mage/src/main/java/mage/abilities/mana/SimpleManaAbility.java b/Mage/src/main/java/mage/abilities/mana/SimpleManaAbility.java index 4998d58b5c..0877a667c2 100644 --- a/Mage/src/main/java/mage/abilities/mana/SimpleManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/SimpleManaAbility.java @@ -1,6 +1,6 @@ - package mage.abilities.mana; +import java.util.ArrayList; import java.util.List; import mage.Mana; import mage.abilities.costs.Cost; @@ -55,7 +55,7 @@ public class SimpleManaAbility extends ActivatedManaAbilityImpl { if (predictable) { return super.getNetMana(game); } - return netMana; + return new ArrayList(netMana); } } diff --git a/Mage/src/main/java/mage/abilities/mana/TriggeredManaAbility.java b/Mage/src/main/java/mage/abilities/mana/TriggeredManaAbility.java index 92054553ac..41173683bd 100644 --- a/Mage/src/main/java/mage/abilities/mana/TriggeredManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/TriggeredManaAbility.java @@ -1,4 +1,3 @@ - package mage.abilities.mana; import java.util.ArrayList; @@ -54,7 +53,7 @@ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl implemen } return newNetMana; } - return netMana; + return new ArrayList(netMana); } /**