1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2025-01-07 19:29:03 +01:00

Cleanup install processor & update documentation

This commit is contained in:
Henry Le Grys 2020-12-22 16:12:39 +00:00
parent ca08bbda34
commit 9f9f94ddb3
4 changed files with 16 additions and 14 deletions

View File

@ -1,3 +1,7 @@
### 1.13+ notice
The launcher now supports modern Forge distributions (1.13+), plus Fabric!
SKCraft Launcher
================
@ -23,7 +27,7 @@ Creating modpacks with this launcher is super easy: :one: only drag & drop of co
The launcher has all standard features that you'd expect like :one: resume of incomplete downloads, :two: incremental updates, and :three: file deduplication (saves disk space when you have files duplicated between updates or modpacks).
LiteLoader, Forge, and .jar mods are supported. You can put resource packs in, or really even random mod files that don't go in the configs or mods folder.
LiteLoader, Forge, Fabric, and custom .jar mods are supported. You can put resource packs in, or really even random mod files that don't go in the configs or mods folder.
You do need some sort of website, but it does **not** need anything complicated like PHP.
@ -54,7 +58,7 @@ Making a modpack is just drag and drop into a folder like this:
* src/**resourcepacks**/
* loaders/
You'd put LiteLoader and Forge into the *loaders* folder. :ok_hand:
LiteLoader and Forge installers, or Fabric Loader, go into the *loaders* folder. :ok_hand:
### More Pictures

View File

@ -68,6 +68,7 @@ public final class Launcher {
@Getter private final LaunchSupervisor launchSupervisor = new LaunchSupervisor(this);
@Getter private final UpdateManager updateManager = new UpdateManager(this);
@Getter private final InstanceTasks instanceTasks = new InstanceTasks(this);
private final Environment env = Environment.getInstance();
/**
* Create a new launcher instance with the given base directory.
@ -281,7 +282,6 @@ public final class Launcher {
* @return File pointing to the library on disk.
*/
public File getLibraryFile(Library library) {
Environment env = Environment.getInstance();
return new File(getLibrariesDir(), library.getPath(env));
}

View File

@ -1,7 +1,6 @@
package com.skcraft.launcher.model.loader;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import lombok.Data;
@ -18,13 +17,8 @@ public class InstallProcessor {
private List<String> args;
private Map<String, String> outputs;
public List<String> resolveArgs(final LoaderSubResolver resolver) {
return Lists.transform(getArgs(), new Function<String, String>() {
@Override
public String apply(String input) {
return resolver.transform(input);
}
});
public List<String> resolveArgs(LoaderSubResolver resolver) {
return Lists.transform(getArgs(), resolver);
}
public Map<String, String> resolveOutputs(final LoaderSubResolver resolver) {
@ -33,7 +27,7 @@ public class InstallProcessor {
HashMap<String, String> result = new HashMap<String, String>();
for (Map.Entry<String, String> entry : getOutputs().entrySet()) {
result.put(resolver.transform(entry.getKey()), resolver.transform(entry.getValue()));
result.put(resolver.apply(entry.getKey()), resolver.apply(entry.getValue()));
}
return result;

View File

@ -1,5 +1,6 @@
package com.skcraft.launcher.model.loader;
import com.google.common.base.Function;
import com.skcraft.launcher.model.minecraft.Library;
import com.skcraft.launcher.model.minecraft.Side;
import com.skcraft.launcher.model.modpack.DownloadableFile;
@ -11,7 +12,7 @@ import java.io.File;
import java.util.HashMap;
@RequiredArgsConstructor
public class LoaderSubResolver {
public class LoaderSubResolver implements Function<String, String> {
private final Manifest manifest;
private final LoaderManifest loader;
private final Environment env;
@ -28,7 +29,10 @@ public class LoaderSubResolver {
return file.getAbsolutePath();
}
public String transform(String arg) {
@Override
public String apply(String arg) {
if (arg == null) return null;
while (true) {
char start = arg.charAt(0);
int bound = arg.length() - 1;