Re-download mod jar in InstanceLauncher if missing
This commit is contained in:
parent
56e7b0194b
commit
9200ee2e2e
|
@ -71,10 +71,12 @@ public class InstanceLauncher {
|
|||
String fn = imod.getFileName().toString();
|
||||
if (Files.exists(imod.getParent().resolve(fn.substring(0, fn.length() - 5))))
|
||||
continue;
|
||||
//TODO load imod from libraries via -Dfabric.addMods
|
||||
Map<ModSource, Optional<ModSource>> sources = Utils.loadObject(imod, ModDescription.class).sources;
|
||||
if (sources.isEmpty()) throw new LaunchException(".imod without attached jar contains no sources");
|
||||
fabricAddMods.append(List.copyOf(sources.keySet()).get(0).getJarPath().toAbsolutePath());
|
||||
ModSource ms = List.copyOf(sources.keySet()).get(0);
|
||||
Path p = ms.getJarPath().toAbsolutePath();
|
||||
if (!Files.exists(p)) ms.download();
|
||||
fabricAddMods.append(p);
|
||||
fabricAddMods.append(File.pathSeparatorChar);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue