From aac6518c1b9619b22f9f983e99d82a3af311d252 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Thu, 14 Oct 2021 04:21:16 -0400 Subject: [PATCH] Remove unofficial Eighth Edition Box and Ninth Edition Box sets --- .../plugins/card/dl/sources/GathererSets.java | 18 +---------- .../dl/sources/ScryfallImageSupportCards.java | 14 +++------ Mage.Sets/src/mage/sets/EighthEditionBox.java | 29 ------------------ Mage.Sets/src/mage/sets/NinthEditionBox.java | 30 ------------------- .../mage/verify/mtgjson/MtgJsonService.java | 2 -- .../java/mage/verify/VerifyCardDataTest.java | 3 -- 6 files changed, 5 insertions(+), 91 deletions(-) delete mode 100644 Mage.Sets/src/mage/sets/EighthEditionBox.java delete mode 100644 Mage.Sets/src/mage/sets/NinthEditionBox.java diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java index b3bda42631..85f8d11c84 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java @@ -68,7 +68,7 @@ public class GathererSets implements Iterable { // "PALP" -- Gatherer does not have the set Asia Pacific Land Program // "ATH" -- has cards from many sets, symbol does not exist on gatherer // "CP", "DPA", "PELP", "PGPX", "PGRU", "H17", "JR", "SWS", // need to fix - "H09", "PD2", "PD3", "UNH", "CM1", "V11", "A25", "UST", "IMA", "DD2", "EVG", "DDC", "DDE", "DDD", "8EB", "9EB", "CHR", "G18", "GVL", "S00", "S99", "UGL" // ok + "H09", "PD2", "PD3", "UNH", "CM1", "V11", "A25", "UST", "IMA", "DD2", "EVG", "DDC", "DDE", "DDD", "CHR", "G18", "GVL", "S00", "S99", "UGL" // ok // current testing }; @@ -160,8 +160,6 @@ public class GathererSets implements Iterable { codeReplacements.put("USG", "UZ"); codeReplacements.put("VIS", "VI"); codeReplacements.put("WTH", "WL"); - codeReplacements.put("8EB", "8ED"); // inner xmage set for 8th edition - codeReplacements.put("9EB", "8ED"); // inner xmage set for 9th edition } public GathererSets() { @@ -175,15 +173,6 @@ public class GathererSets implements Iterable { // checks for wrong card settings and support (easy to control what all good) private static final HashMap setsToDownload = new HashMap<>(); - private static final HashMap codesToIgnoreCheck = new HashMap<>(); - - static { - // xMage have inner sets for 8th and 9th Edition for booster workaround (cards from core game do not include in boosters) - // see https://mtg.gamepedia.com/8th_Edition/Core_Game - // check must ignore that sets - codesToIgnoreCheck.put("8EB", "8th Edition Box"); - codesToIgnoreCheck.put("9EB", "9th Edition Box"); - } private void CheckSearchResult(String searchCode, ExpansionSet foundedExp, boolean canDownloadTask, boolean haveCommon, boolean haveUncommon, boolean haveRare, boolean haveMyth) { @@ -220,11 +209,6 @@ public class GathererSets implements Iterable { for (ExpansionSet set : Sets.getInstance().values()) { - // ignore some inner sets - if (codesToIgnoreCheck.get(set.getCode()) != null) { - continue; - } - CheckResult res = setsToDownload.get(set.getCode()); // 1. not configured at all diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java index 04de9873ae..082134ea4f 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java @@ -16,10 +16,6 @@ import java.util.regex.Pattern; */ public class ScryfallImageSupportCards { - private static final Map xmageSetsToScryfall = ImmutableMap.builder() - .put("8EB", "8ED") - .put("9EB", "9ED") - .build(); static final Pattern REGEXP_DIRECT_KEY_SET_CODE_PATTERN = Pattern.compile("(\\w+)\\/", Pattern.MULTILINE); static final Pattern REGEXP_DIRECT_KEY_CARD_NAME_PATTERN = Pattern.compile("\\/(.+?)\\/", Pattern.MULTILINE); @@ -125,7 +121,6 @@ public class ScryfallImageSupportCards { add("LGN"); // Legions add("SCG"); // Scourge add("8ED"); // Eighth Edition - add("8EB"); // Eighth Edition Box add("WC03"); // World Championship Decks 2003 add("MRD"); // Mirrodin add("PAL04"); // Arena League 2004 @@ -145,7 +140,6 @@ public class ScryfallImageSupportCards { add("BOK"); // Betrayers of Kamigawa add("SOK"); // Saviors of Kamigawa add("9ED"); // Ninth Edition - add("9EB"); // Ninth Edition Box //add("PSAL"); // Salvat 2005 add("RAV"); // Ravnica: City of Guilds add("P2HG"); // Two-Headed Giant Tournament @@ -957,7 +951,7 @@ public class ScryfallImageSupportCards { }; public static String findScryfallSetCode(String xmageCode) { - return xmageSetsToScryfall.getOrDefault(xmageCode, xmageCode).toLowerCase(Locale.ENGLISH); + return xmageCode.toLowerCase(Locale.ENGLISH); } public static Set getSupportedSets() { @@ -987,8 +981,8 @@ public class ScryfallImageSupportCards { } public static String extractSetCodeFromDirectKey(String key) { - // from: 8EB/Giant Octopus - // to: 8EB + // from: 8ED/Giant Octopus + // to: 8ED Matcher matcher = REGEXP_DIRECT_KEY_SET_CODE_PATTERN.matcher(key); if (matcher.find()) { return matcher.group(1); @@ -997,7 +991,7 @@ public class ScryfallImageSupportCards { } public static String extractCardNameFromDirectKey(String key) { - // from: 8EB/Giant Octopus/ + // from: 8ED/Giant Octopus/ // to: Giant Octopus Matcher matcher = REGEXP_DIRECT_KEY_CARD_NAME_PATTERN.matcher(key + "/"); // add / for regexp workaround if (matcher.find()) { diff --git a/Mage.Sets/src/mage/sets/EighthEditionBox.java b/Mage.Sets/src/mage/sets/EighthEditionBox.java deleted file mode 100644 index f9fbcce4b1..0000000000 --- a/Mage.Sets/src/mage/sets/EighthEditionBox.java +++ /dev/null @@ -1,29 +0,0 @@ -package mage.sets; - -import mage.cards.ExpansionSet; -import mage.constants.Rarity; -import mage.constants.SetType; - -public final class EighthEditionBox extends ExpansionSet { - - private static final EighthEditionBox instance = new EighthEditionBox(); - - public static EighthEditionBox getInstance() { - return instance; - } - - private EighthEditionBox() { - super("Eighth Edition Box", "8EB", ExpansionSet.buildDate(2003, 7, 28), SetType.CORE); - this.hasBoosters = false; - this.hasBasicLands = false; - - // http://www.magiclibrarities.net/540-rarities-eighth-edition-box-set-cards-english-cards-index.html - cards.add(new SetCardInfo("Eager Cadet", "S1", Rarity.COMMON, mage.cards.e.EagerCadet.class)); - cards.add(new SetCardInfo("Enormous Baloth", "S6", Rarity.UNCOMMON, mage.cards.e.EnormousBaloth.class)); - cards.add(new SetCardInfo("Giant Octopus", "S3", Rarity.COMMON, mage.cards.g.GiantOctopus.class)); - cards.add(new SetCardInfo("Sea Eagle", "S4", Rarity.COMMON, mage.cards.s.SeaEagle.class)); - cards.add(new SetCardInfo("Silverback Ape", "S7", Rarity.UNCOMMON, mage.cards.s.SilverbackApe.class)); - cards.add(new SetCardInfo("Vengeance", "S2", Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); - cards.add(new SetCardInfo("Vizzerdrix", "S5", Rarity.RARE, mage.cards.v.Vizzerdrix.class)); - } -} diff --git a/Mage.Sets/src/mage/sets/NinthEditionBox.java b/Mage.Sets/src/mage/sets/NinthEditionBox.java deleted file mode 100644 index 9af6401f41..0000000000 --- a/Mage.Sets/src/mage/sets/NinthEditionBox.java +++ /dev/null @@ -1,30 +0,0 @@ -package mage.sets; - -import mage.cards.ExpansionSet; -import mage.constants.Rarity; -import mage.constants.SetType; - -public final class NinthEditionBox extends ExpansionSet { - - private static final NinthEditionBox instance = new NinthEditionBox(); - - public static NinthEditionBox getInstance() { - return instance; - } - - private NinthEditionBox() { - super("Ninth Edition Box", "9EB", ExpansionSet.buildDate(2005, 7, 29), SetType.CORE); - this.hasBoosters = false; - this.hasBasicLands = false; - - cards.add(new SetCardInfo("Coral Eel", "S3", Rarity.COMMON, mage.cards.c.CoralEel.class)); - cards.add(new SetCardInfo("Eager Cadet", "S1", Rarity.COMMON, mage.cards.e.EagerCadet.class)); - cards.add(new SetCardInfo("Enormous Baloth", "S9", Rarity.UNCOMMON, mage.cards.e.EnormousBaloth.class)); - cards.add(new SetCardInfo("Giant Octopus", "S4", Rarity.COMMON, mage.cards.g.GiantOctopus.class)); - cards.add(new SetCardInfo("Goblin Raider", "S8", Rarity.COMMON, mage.cards.g.GoblinRaider.class)); - cards.add(new SetCardInfo("Index", "S5", Rarity.COMMON, mage.cards.i.Index.class)); - cards.add(new SetCardInfo("Spined Wurm", "S10", Rarity.COMMON, mage.cards.s.SpinedWurm.class)); - cards.add(new SetCardInfo("Vengeance", "S2", Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); - cards.add(new SetCardInfo("Vizzerdrix", "S7", Rarity.RARE, mage.cards.v.Vizzerdrix.class)); - } -} diff --git a/Mage.Verify/src/main/java/mage/verify/mtgjson/MtgJsonService.java b/Mage.Verify/src/main/java/mage/verify/mtgjson/MtgJsonService.java index dbc1935c86..6171d0774d 100644 --- a/Mage.Verify/src/main/java/mage/verify/mtgjson/MtgJsonService.java +++ b/Mage.Verify/src/main/java/mage/verify/mtgjson/MtgJsonService.java @@ -24,8 +24,6 @@ public final class MtgJsonService { for (Map.Entry entry : mtgJsonToXMageCodes.entrySet()) { xMageToMtgJsonCodes.put(entry.getValue(), entry.getKey()); } - xMageToMtgJsonCodes.put("8EB", "8ED"); - xMageToMtgJsonCodes.put("9EB", "9ED"); } private static Map loadAllCards() throws IOException { diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index dbf4da3b70..7e88983e48 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -201,8 +201,6 @@ public class VerifyCardDataTest { // scryfall download sets (missing from scryfall website) skipListCreate(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS); skipListAddName(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS, "SWS"); // Star Wars - //skipListAddName(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS, "8EB"); // Eighth Edition Box - inner xmage set, split from 8ED - //skipListAddName(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS, "9EB"); // Ninth Edition Box - inner xmage set, split from 9ED // sample decks checking - some decks can contains unimplemented cards, so ignore it // file name must be related to sample-decks folder @@ -481,7 +479,6 @@ public class VerifyCardDataTest { continue; } - // TODO: 8EB and 9EB uses workaround to split from main set, so it will be in unofficial list until booster cards improve xmageUnofficialSets++; xmageUnofficialCards += set.getSetCardInfo().size(); info.add("Unofficial set: " + set.getCode() + " - " + set.getName() + ", cards: " + set.getSetCardInfo().size() + ", year: " + set.getReleaseYear());