mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Warn once for repeated pack warnings
- Warn once per pack, type and key for missing resources in the resource loaders - Warn once per file for unreadable resources and report the stack only the first time - Warn once for unknown loot materials, missing loot tables and objects without a load key - Add IrisLogging.forgetOnceKeys(prefix) for scoped resets - Forget a pack's warn-once keys on clearLists() and hotloaded() so a rebroken key warns again - Add tests for scoped reset, loader misses, read failures, loot and marker warnings
This commit is contained in:
1 parent
832070cd69
commit
2adfbd4f5d
16 files changed
+705
-48
No files matched your search
@@ -199,6 +199,19 @@ public final class IrisLogging {
|
||||
ONCE_KEYS.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Forgets only the once-keys that start with {@code prefix}, so one scope (a pack that was just
|
||||
* hotloaded) can warn again while every other scope stays claimed. A null or empty prefix is ignored
|
||||
* rather than clearing everything; {@link #resetOnceKeys()} is the global reset.
|
||||
*/
|
||||
public static void forgetOnceKeys(String prefix) {
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ONCE_KEYS.removeIf(key -> key.startsWith(prefix));
|
||||
}
|
||||
|
||||
private static boolean once(LogLevel level, String key, String format, Object... args) {
|
||||
String message = format(format, args);
|
||||
if (!claim(key)) {
|
||||
|
||||
Reference in new issue
Block a user