diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index d9468b5a9e0..3fd5caa383f 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -56,8 +56,8 @@ public abstract class AbilityImpl implements Ability { protected AbilityType abilityType; protected UUID controllerId; protected UUID sourceId; - private ManaCosts manaCosts; - private ManaCosts manaCostsToPay; + private final ManaCosts manaCosts; + private final ManaCosts manaCostsToPay; private Costs costs; protected Modes modes; // access to it by GetModes only (it can be overridden by some abilities) protected Zone zone; @@ -83,7 +83,7 @@ public abstract class AbilityImpl implements Ability { protected String appendToRule = null; protected int sourcePermanentTransformCount = 0; - public AbilityImpl(AbilityType abilityType, Zone zone) { + protected AbilityImpl(AbilityType abilityType, Zone zone) { this.id = UUID.randomUUID(); this.originalId = id; this.abilityType = abilityType; @@ -879,9 +879,6 @@ public abstract class AbilityImpl implements Ability { if (manaCost == null) { return; } - if (manaCostsToPay == null) { - manaCostsToPay = new ManaCostsImpl<>(); - } if (manaCost instanceof ManaCosts) { manaCostsToPay.addAll((ManaCosts) manaCost); } else { @@ -894,14 +891,6 @@ public abstract class AbilityImpl implements Ability { if (manaCost == null) { return; } - - if (manaCosts == null) { - manaCosts = new ManaCostsImpl<>(); - } - if (manaCostsToPay == null) { - manaCostsToPay = new ManaCostsImpl<>(); - } - manaCosts.add(manaCost); manaCostsToPay.add(manaCost); }