File tree Expand file tree Collapse file tree
forge-core/src/main/java/forge/token Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,12 +103,23 @@ protected PaperToken fallbackToken(String name, CardEdition realEdition) {
103103
104104 // Find latest token before release of original card, or earliest after that
105105 private PaperToken smartFallbackToken (String name , CardEdition realEdition ) {
106+ PaperToken coreExpansionReprintToken = smartFallbackToken (name , realEdition , true );
107+ return coreExpansionReprintToken != null ? coreExpansionReprintToken : smartFallbackToken (name , realEdition , false );
108+ }
109+
110+ private PaperToken smartFallbackToken (String name , CardEdition realEdition , boolean onlyCoreExpansionOrReprint ) {
106111 String latestFound = null ;
107112 boolean pastRealEdition = false ;
113+ final EnumSet <CardEdition .Type > coreExpansionOrReprint = EnumSet .of (CardEdition .Type .CORE , CardEdition .Type .EXPANSION );
114+ coreExpansionOrReprint .addAll (CardEdition .Type .REPRINT_SET_TYPES );
108115 for (CardEdition edition : this .editions .getOrderedEditions (false )) {
109116 if (edition .equals (realEdition )) {
110117 pastRealEdition = true ;
111118 }
119+ if (onlyCoreExpansionOrReprint && !coreExpansionOrReprint .contains (edition .getType ())) {
120+ // Core, Expansion and Reprint sets are more likely to have available token images
121+ continue ;
122+ }
112123 String fullName = String .format ("%s_%s" , name , edition .getCode ().toLowerCase ());
113124 if (loadTokenFromSet (edition , name )) {
114125 latestFound = fullName ;
You can’t perform that action at this time.
0 commit comments