From e0972e53498d8d6f5df3c57c1d845f610c6b88cb Mon Sep 17 00:00:00 2001 From: asie Date: Wed, 21 Nov 2018 18:33:25 +0100 Subject: [PATCH] update stitch, fix error when mappings partially present --- build.gradle | 2 +- .../net/fabricmc/loom/providers/PomfProvider.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index cabac42..ff67c77 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ dependencies { implementation ('org.zeroturnaround:zt-zip:1.13') implementation ('com.google.code.gson:gson:2.8.5') implementation ('com.google.guava:guava:27.0-jre') - implementation ('net.fabricmc:stitch:0.1.0.8') + implementation ('net.fabricmc:stitch:0.1.0.9') implementation ('net.fabricmc:tiny-remapper:0.1.0.18') { transitive = false } diff --git a/src/main/java/net/fabricmc/loom/providers/PomfProvider.java b/src/main/java/net/fabricmc/loom/providers/PomfProvider.java index 5acc458..570e700 100644 --- a/src/main/java/net/fabricmc/loom/providers/PomfProvider.java +++ b/src/main/java/net/fabricmc/loom/providers/PomfProvider.java @@ -71,10 +71,16 @@ public class PomfProvider extends DependencyProvider { } if (!MAPPINGS_TINY_BASE.exists() || !MAPPINGS_TINY.exists()) { - project.getLogger().lifecycle(":extracting " + mappingsJar.getName()); - try (FileSystem fileSystem = FileSystems.newFileSystem(mappingsJar.toPath(), null)) { - Path fileToExtract = fileSystem.getPath("mappings/mappings.tiny"); - Files.copy(fileToExtract, MAPPINGS_TINY_BASE.toPath()); + if (!MAPPINGS_TINY_BASE.exists()) { + project.getLogger().lifecycle(":extracting " + mappingsJar.getName()); + try (FileSystem fileSystem = FileSystems.newFileSystem(mappingsJar.toPath(), null)) { + Path fileToExtract = fileSystem.getPath("mappings/mappings.tiny"); + Files.copy(fileToExtract, MAPPINGS_TINY_BASE.toPath()); + } + } + + if (MAPPINGS_TINY.exists()) { + MAPPINGS_TINY.delete(); } project.getLogger().lifecycle(":populating field names");