diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java index fbc6e720d..ca405b28f 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java @@ -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; + }))); + } } } }