diff --git a/forge-core/src/main/java/forge/item/PaperCard.java b/forge-core/src/main/java/forge/item/PaperCard.java index 942f88b5536..364f0a79623 100644 --- a/forge-core/src/main/java/forge/item/PaperCard.java +++ b/forge-core/src/main/java/forge/item/PaperCard.java @@ -347,13 +347,34 @@ public class PaperCard implements Comparable, InventoryItemFromSet, if (pc == null) { pc = StaticData.instance().getVariantCards().getCard(name, edition, artIndex); if (pc == null) { - throw new IOException(TextUtil.concatWithSpace("Card", name, "not found")); + System.out.println("PaperCard: " + name + " not found with set and index " + edition + ", " + artIndex); + pc = readObjectAlternate(name, edition); + if (pc == null) { + throw new IOException(TextUtil.concatWithSpace("Card", name, "not found with set and index", edition, Integer.toString(artIndex))); + } + System.out.println("Alternate object found: " + pc.getName() + ", " + pc.getEdition() + ", " + pc.getArtIndex()); } } rules = pc.getRules(); rarity = pc.getRarity(); } + private IPaperCard readObjectAlternate(String name, String edition) throws ClassNotFoundException, IOException { + IPaperCard pc = StaticData.instance().getCommonCards().getCard(name, edition); + if (pc == null) { + pc = StaticData.instance().getVariantCards().getCard(name, edition); + } + + if (pc == null) { + pc = StaticData.instance().getCommonCards().getCard(name); + if (pc == null) { + pc = StaticData.instance().getVariantCards().getCard(name); + } + } + + return pc; + } + @Serial private Object readResolve() throws ObjectStreamException { //If we deserialize an old PaperCard with no flags, reinitialize as a fresh copy to set default flags.