From 992470e1ea1cba3a2db55231c0f119756df536a4 Mon Sep 17 00:00:00 2001 From: Quercitron Date: Sun, 8 Jul 2018 17:23:44 +0300 Subject: [PATCH] Fix that MaxCardNumberInBooster filter is applied incorrectly and only part of the commons is used for booster generation in the Core Set 2019, Dragon's Maze and Fate Reforged sets --- Mage.Sets/src/mage/sets/CoreSet2019.java | 6 +++--- Mage.Sets/src/mage/sets/DragonsMaze.java | 6 +++--- Mage.Sets/src/mage/sets/FateReforged.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 525de25c51..132743ef00 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -370,10 +370,10 @@ public final class CoreSet2019 extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.rarities(Rarity.COMMON); criteria.setCodes(this.code).notTypes(CardType.LAND); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to let modify the original. diff --git a/Mage.Sets/src/mage/sets/DragonsMaze.java b/Mage.Sets/src/mage/sets/DragonsMaze.java index d9e10a58ea..8e01820b2a 100644 --- a/Mage.Sets/src/mage/sets/DragonsMaze.java +++ b/Mage.Sets/src/mage/sets/DragonsMaze.java @@ -202,10 +202,10 @@ public final class DragonsMaze extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.setCodes(this.code).notTypes(CardType.LAND); criteria.rarities(rarity).doubleFaced(false); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to modify the original. diff --git a/Mage.Sets/src/mage/sets/FateReforged.java b/Mage.Sets/src/mage/sets/FateReforged.java index e500a7f1bf..0cc077d3ed 100644 --- a/Mage.Sets/src/mage/sets/FateReforged.java +++ b/Mage.Sets/src/mage/sets/FateReforged.java @@ -236,10 +236,10 @@ public final class FateReforged extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.rarities(Rarity.COMMON); criteria.setCodes(this.code).notTypes(CardType.LAND); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to let modify the original.