Fix dep refreshing being broken with ForgeUserdevProvider

This commit is contained in:
Juuxel
2020-07-30 17:26:21 +03:00
parent 0f5efe13c9
commit d4ceb857eb

View File

@@ -31,6 +31,7 @@ import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.function.Consumer;
import com.google.common.collect.ImmutableMap;
@@ -60,10 +61,10 @@ public class ForgeUserdevProvider extends DependencyProvider {
if (!userdevJar.exists() || Files.notExists(configJson) || isRefreshDeps()) {
File resolved = dependency.resolveFile().orElseThrow(() -> new RuntimeException("Could not resolve Forge userdev"));
Files.copy(resolved.toPath(), userdevJar.toPath());
Files.copy(resolved.toPath(), userdevJar.toPath(), StandardCopyOption.REPLACE_EXISTING);
try (FileSystem fs = FileSystems.newFileSystem(new URI("jar:" + resolved.toURI()), ImmutableMap.of("create", false))) {
Files.copy(fs.getPath("config.json"), configJson);
Files.copy(fs.getPath("config.json"), configJson, StandardCopyOption.REPLACE_EXISTING);
}
}