Skip to content

Commit

Permalink
Check refmaps exist before adding them to mixin configs (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 authored Dec 15, 2023
1 parent 014a6fc commit f2e8ff2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/net/fabricmc/loom/task/RemapJarTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,15 @@ private void addRefmaps() throws IOException {
}

for (RemapParams.RefmapData refmapData : getParameters().getMixinData().get()) {
int transformed = ZipUtils.transformJson(JsonObject.class, outputFile, refmapData.mixinConfigs().stream().collect(Collectors.toMap(s -> s, s -> json -> {
if (!json.has("refmap")) {
json.addProperty("refmap", refmapData.refmapName());
}

return json;
})));
if (ZipUtils.contains(outputFile, refmapData.refmapName())) {
int transformed = ZipUtils.transformJson(JsonObject.class, outputFile, refmapData.mixinConfigs().stream().collect(Collectors.toMap(s -> s, s -> json -> {
if (!json.has("refmap")) {
json.addProperty("refmap", refmapData.refmapName());
}

return json;
})));
}
}
}
}
Expand Down

0 comments on commit f2e8ff2

Please sign in to comment.