Skip to content

Commit

Permalink
Merge pull request #798 from pietro-lopes/2001
Browse files Browse the repository at this point in the history
fix tags export from kubejs export command
  • Loading branch information
LatvianModder authored Mar 26, 2024
2 parents ca0b6b8 + 74b22f7 commit caa37aa
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions common/src/main/java/dev/latvian/mods/kubejs/core/TagLoaderKJS.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,29 @@ public interface TagLoaderKJS<T> {
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<String>();
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<String>();

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

0 comments on commit caa37aa

Please sign in to comment.