diff --git a/common/src/main/java/net/neoforged/gradle/common/util/CommonRuntimeTaskUtils.java b/common/src/main/java/net/neoforged/gradle/common/util/CommonRuntimeTaskUtils.java index ae5ce516f..4b353fb1b 100644 --- a/common/src/main/java/net/neoforged/gradle/common/util/CommonRuntimeTaskUtils.java +++ b/common/src/main/java/net/neoforged/gradle/common/util/CommonRuntimeTaskUtils.java @@ -32,7 +32,16 @@ public static TaskProvider createAccessTransformer( final TaskProvider provider = definition.getSpecification().getProject().getTasks().register(name, ArtifactProvider.class, task -> { task.getInput().set(file); - task.getOutput().set(new File(workspaceDirectory, "accesstransformers/" + namePreFix + "/" + file.getName())); + String outputFileName = file.getName(); + if (index > 0) { + int extensionDot = outputFileName.lastIndexOf('.'); + if (extensionDot == -1) { + outputFileName += "_" + index; + } else { + outputFileName = outputFileName.substring(0, extensionDot) + "_" + index + outputFileName.substring(extensionDot); + } + } + task.getOutput().set(new File(workspaceDirectory, "accesstransformers/" + namePreFix + "/" + outputFileName)); }); fileProducingTasks.add(provider);