diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index c6eab37810..1ed8cad43c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -150,7 +150,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public CardTestPlayerAPIImpl() { // load all cards to db from class list ArrayList errorsList = new ArrayList<>(); - if (FAST_SCAN_WITHOUT_DATABASE_CREATE && CardRepository.instance.findCard("Mountain") != null) { + if (FAST_SCAN_WITHOUT_DATABASE_CREATE && CardRepository.instance.findCard("XLN", "272") != null) { CardScanner.scanned = true; } CardScanner.scan(errorsList); @@ -665,14 +665,14 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.fail("Can't add card " + cardName + " - alias " + aliasName + " already exists for " + player.getName()); } + CardInfo cardInfo = CardRepository.instance.findCard(cardName); + if (cardInfo == null) { + throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); + } + if (gameZone == Zone.BATTLEFIELD) { for (int i = 0; i < count; i++) { - CardInfo cardInfo = CardRepository.instance.findCard(cardName); - Card newCard = cardInfo != null ? cardInfo.getCard() : null; - if (newCard == null) { - throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); - } - + Card newCard = cardInfo.getCard(); Card permCard = CardUtil.getDefaultCardSideForBattlefield(newCard); PermanentCard p = new PermanentCard(permCard, player.getId(), currentGame); @@ -689,15 +689,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } List cards = getCardList(gameZone, player); for (int i = 0; i < count; i++) { - CardInfo cardInfo = CardRepository.instance.findCard(cardName); - Card card = cardInfo != null ? cardInfo.getCard() : null; - if (card == null) { - throw new AssertionError("Couldn't find a card in db: " + cardName); - } - cards.add(card); - + Card newCard = cardInfo.getCard(); + cards.add(newCard); if (!aliasName.isEmpty()) { - player.addAlias(player.generateAliasName(aliasName, useAliasMultiNames, i + 1), card.getId()); + player.addAlias(player.generateAliasName(aliasName, useAliasMultiNames, i + 1), newCard.getId()); } } } diff --git a/Mage/src/main/java/mage/abilities/Modes.java b/Mage/src/main/java/mage/abilities/Modes.java index dc72411508..b64179d50e 100644 --- a/Mage/src/main/java/mage/abilities/Modes.java +++ b/Mage/src/main/java/mage/abilities/Modes.java @@ -127,7 +127,7 @@ public class Modes extends LinkedHashMap { } public List getSelectedModes() { - // sorted as original modes + // modes can be selected in any order by user, but execution must be in rule's order List res = new ArrayList<>(); for (Mode mode : this.values()) { for (UUID selectedId : this.selectedModes) {