diff --git a/common/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java b/common/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java index ca65c2360..2f05ca671 100644 --- a/common/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java +++ b/common/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java @@ -64,29 +64,29 @@ public interface TagLoaderKJS { map.put(entry.getKey(), entry.getValue().entries); } - if (DataExport.export != null) { - var loc = "tags/" + regInfo + "/"; + if (event.totalAdded > 0 || event.totalRemoved > 0 || ConsoleJS.SERVER.shouldPrintDebug()) { + ConsoleJS.SERVER.info("[%s] Found %d tags, added %d objects, removed %d objects".formatted(regInfo, event.tags.size(), event.totalAdded, event.totalRemoved)); + } + } - for (var entry : map.entrySet()) { - var list = new ArrayList(); + if (DataExport.export != null) { + var loc = "tags/" + regInfo + "/"; - for (var e : entry.getValue()) { - list.add(e.entry().toString()); - } + for (var entry : map.entrySet()) { + var list = new ArrayList(); - list.sort(String.CASE_INSENSITIVE_ORDER); - var arr = new JsonArray(); + for (var e : entry.getValue()) { + list.add(e.entry().toString()); + } - for (var e : list) { - arr.add(e); - } + list.sort(String.CASE_INSENSITIVE_ORDER); + var arr = new JsonArray(); - DataExport.export.addJson(loc + entry.getKey() + ".json", arr); + for (var e : list) { + arr.add(e); } - } - if (event.totalAdded > 0 || event.totalRemoved > 0 || ConsoleJS.SERVER.shouldPrintDebug()) { - ConsoleJS.SERVER.info("[%s] Found %d tags, added %d objects, removed %d objects".formatted(regInfo, event.tags.size(), event.totalAdded, event.totalRemoved)); + DataExport.export.addJson(loc + entry.getKey() + ".json", arr); } } }