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();
}

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);
}