From 69f15e870cb812152bb56d2713b95520f3ca8885 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 18 Jun 2018 16:55:51 +0100 Subject: [PATCH] Ensure file is moved --- src/main/java/net/fabricmc/loom/util/ModRemapper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/fabricmc/loom/util/ModRemapper.java b/src/main/java/net/fabricmc/loom/util/ModRemapper.java index 20d0ddd..f4d5dba 100644 --- a/src/main/java/net/fabricmc/loom/util/ModRemapper.java +++ b/src/main/java/net/fabricmc/loom/util/ModRemapper.java @@ -28,6 +28,7 @@ import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.tinyremapper.OutputConsumerPath; import net.fabricmc.tinyremapper.TinyRemapper; import net.fabricmc.tinyremapper.TinyUtils; +import org.apache.commons.io.FileUtils; import org.gradle.api.Project; import java.io.File; @@ -53,8 +54,11 @@ public class ModRemapper { deobfJar.delete(); } + FileUtils.touch(modJar); //Done to ensure that the file can be moved //Move the pre existing mod jar to the deobf jar - modJar.renameTo(deobfJar); + if(!modJar.renameTo(deobfJar)){ + throw new RuntimeException("Failed to rename " + modJar); + } Path mappings = Constants.MAPPINGS_TINY.get(extension).toPath();