fix infinite notice for missing tokens

This commit is contained in:
kevlahnota
2024-11-15 16:26:05 +08:00
parent bd18600385
commit 4b13e55d83
2 changed files with 7 additions and 2 deletions

View File

@@ -85,7 +85,7 @@ public final class ImageKeys {
}
private static final Map<String, File> cachedCards = new HashMap<>(50000);
private static HashSet<String> missingCards = new HashSet<>();
public static HashSet<String> missingCards = new HashSet<>();
public static void clearMissingCards() {
missingCards.clear();
}
@@ -310,7 +310,7 @@ public final class ImageKeys {
}
// System.out.println("File not found, no image created: " + key);
//add missing cards - disable for desktop version for compatibility reasons with autodownloader
// add missing cards - disable for desktop version for compatibility reasons with autodownloader
if (isLibGDXPort && !hasSetLookup(filename)) //missing cards with setlookup is handled differently
missingCards.add(filename);
return null;

View File

@@ -228,6 +228,11 @@ public abstract class ImageFetcher {
}
if (filename.equalsIgnoreCase("null.jpg"))
return;
if (ImageKeys.missingCards.contains(filename))
return;
ImageKeys.missingCards.add(filename);
System.err.println("No specified file for '" + filename + "'.. Attempting to download from default Url");
tokenUrl = String.format("%s%s", ForgeConstants.URL_TOKEN_DOWNLOAD, filename);
}