summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java157
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/converter/Main.java53
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/Bootstrap.java78
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java6
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/MainV2.java15
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java52
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/util/ModuleUtil.java21
-rw-r--r--src/main/resources/META-INF/services/io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector2
-rw-r--r--src/main/resources/META-INF/services/java.util.function.Consumer1
-rw-r--r--src/main/resources/mmc-pack.json13
-rw-r--r--src/main/resources/patches/net.minecraftforge.json28
11 files changed, 146 insertions, 280 deletions
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java b/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java
deleted file mode 100644
index 403488bd95..0000000000
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Converter.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package io.github.zekerzhayard.forgewrapper.converter;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonNull;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
-public class Converter {
- public static void convert(Path installerPath, Path targetDir, Path multimcDir) throws Exception {
- JsonObject installer = getJsonFromZip(installerPath, "version.json");
- JsonObject installProfile = getJsonFromZip(installerPath, "install_profile.json");
- List<String> arguments = getAdditionalArgs(installer);
- String mcVersion = arguments.get(arguments.indexOf("--fml.mcVersion") + 1);
- String forgeVersion = arguments.get(arguments.indexOf("--fml.forgeVersion") + 1);
- String forgeFullVersion = "forge-" + mcVersion + "-" + forgeVersion;
- StringBuilder wrapperVersion = new StringBuilder();
-
- JsonObject pack = convertPackJson(mcVersion);
- JsonObject patches = convertPatchesJson(installer, installProfile, mcVersion, forgeVersion, wrapperVersion);
-
- Files.createDirectories(targetDir);
-
- // Copy mmc-pack.json and instance.cfg to <instance> folder.
- Path instancePath = targetDir.resolve(forgeFullVersion);
- Files.createDirectories(instancePath);
- Files.copy(new ByteArrayInputStream(pack.toString().getBytes(StandardCharsets.UTF_8)), instancePath.resolve("mmc-pack.json"), StandardCopyOption.REPLACE_EXISTING);
- Files.copy(new ByteArrayInputStream(("InstanceType=OneSix\nname=" + forgeFullVersion).getBytes(StandardCharsets.UTF_8)), instancePath.resolve("instance.cfg"), StandardCopyOption.REPLACE_EXISTING);
-
- // Copy ForgeWrapper to <instance>/libraries folder.
- Path librariesPath = instancePath.resolve("libraries");
- Files.createDirectories(librariesPath);
- Files.copy(Paths.get(Converter.class.getProtectionDomain().getCodeSource().getLocation().toURI()), librariesPath.resolve(wrapperVersion.toString()), StandardCopyOption.REPLACE_EXISTING);
-
- // Copy net.minecraftforge.json to <instance>/patches folder.
- Path patchesPath = instancePath.resolve("patches");
- Files.createDirectories(patchesPath);
- Files.copy(new ByteArrayInputStream(patches.toString().getBytes(StandardCharsets.UTF_8)), patchesPath.resolve("net.minecraftforge.json"), StandardCopyOption.REPLACE_EXISTING);
-
- // Copy forge installer to MultiMC/libraries/net/minecraftforge/forge/<mcVersion>-<forgeVersion> folder.
- if (multimcDir != null) {
- Path targetInstallerPath = multimcDir.resolve("libraries").resolve("net").resolve("minecraftforge").resolve("forge").resolve(forgeVersion);
- Files.createDirectories(targetInstallerPath);
- Files.copy(installerPath, targetInstallerPath.resolve(forgeFullVersion + "-installer.jar"), StandardCopyOption.REPLACE_EXISTING);
- }
- }
-
- public static List<String> getAdditionalArgs(JsonObject installer) {
- List<String> args = new ArrayList<>();
- getElement(installer.getAsJsonObject("arguments"), "game").getAsJsonArray().iterator().forEachRemaining(je -> args.add(je.getAsString()));
- return args;
- }
-
- public static JsonObject getJsonFromZip(Path path, String json) {
- try {
- ZipFile zf = new ZipFile(path.toFile());
- ZipEntry versionFile = zf.getEntry(json);
- if (versionFile == null) {
- throw new RuntimeException("The zip file is invalid!");
- }
- InputStreamReader isr = new InputStreamReader(zf.getInputStream(versionFile), StandardCharsets.UTF_8);
- return new JsonParser().parse(isr).getAsJsonObject();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- // Convert mmc-pack.json:
- // - Replace Minecraft version
- private static JsonObject convertPackJson(String mcVersion) {
- JsonObject pack = new JsonParser().parse(new InputStreamReader(Converter.class.getResourceAsStream("/mmc-pack.json"))).getAsJsonObject();
-
- for (JsonElement component : getElement(pack, "components").getAsJsonArray()) {
- JsonObject componentObject = component.getAsJsonObject();
- JsonElement version = getElement(componentObject, "version");
- if (!version.isJsonNull() && getElement(componentObject, "uid").getAsString().equals("net.minecraft")) {
- componentObject.addProperty("version", mcVersion);
- }
- }
- return pack;
- }
-
- // Convert patches/net.minecraftforge.json:
- // - Add libraries
- // - Add forge-launcher url
- // - Replace Minecraft & Forge versions
- private static JsonObject convertPatchesJson(JsonObject installer, JsonObject installProfile, String mcVersion, String forgeVersion, StringBuilder wrapperVersion) {
- JsonObject patches = new JsonParser().parse(new InputStreamReader(Converter.class.getResourceAsStream("/patches/net.minecraftforge.json"))).getAsJsonObject();
- JsonArray mavenFiles = getElement(patches, "mavenFiles").getAsJsonArray();
- JsonArray libraries = getElement(patches, "libraries").getAsJsonArray();
-
- String minecraftArguments = String.join(" ", getElement(patches, "minecraftArguments").getAsString(), "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userType ${user_type} --versionType ${version_type}", String.join(" ", getAdditionalArgs(installer))).trim();
- patches.addProperty("minecraftArguments", minecraftArguments);
-
- for (JsonElement mavenFile : mavenFiles) {
- String name = getElement(mavenFile.getAsJsonObject(), "name").getAsString();
- mavenFile.getAsJsonObject().addProperty("name", name.replace("{VERSION}", mcVersion).replace("{FORGE_VERSION}", forgeVersion));
- }
- for (JsonElement lib : libraries) {
- String name = getElement(lib.getAsJsonObject(), "name").getAsString();
- if (name.startsWith("io.github.zekerzhayard:ForgeWrapper:")) {
- wrapperVersion.append(getElement(lib.getAsJsonObject(), "MMC-filename").getAsString());
- }
- }
- Map<String, String> additionalUrls = new HashMap<>();
- String path = String.format("net/minecraftforge/forge/%s-%s/forge-%s-%s", mcVersion, forgeVersion, mcVersion, forgeVersion);
- additionalUrls.put(path + "-universal.jar", "https://files.minecraftforge.net/maven/" + path + "-universal.jar");
- transformLibraries(getElement(installProfile, "libraries").getAsJsonArray(), mavenFiles, additionalUrls);
- additionalUrls.clear();
- additionalUrls.put(path + ".jar", "https://files.minecraftforge.net/maven/" + path + "-launcher.jar");
- transformLibraries(getElement(installer ,"libraries").getAsJsonArray(), libraries, additionalUrls);
-
- patches.addProperty("version", forgeVersion);
- for (JsonElement require : getElement(patches, "requires").getAsJsonArray()) {
- JsonObject requireObject = require.getAsJsonObject();
- if (getElement(requireObject, "uid").getAsString().equals("net.minecraft")) {
- requireObject.addProperty("equals", mcVersion);
- }
- }
- return patches;
- }
-
- private static JsonElement getElement(JsonObject object, String property) {
- Optional<Map.Entry<String, JsonElement>> first = object.entrySet().stream().filter(e -> e.getKey().equals(property)).findFirst();
- if (first.isPresent()) {
- return first.get().getValue();
- }
- return JsonNull.INSTANCE;
- }
-
- private static void transformLibraries(JsonArray source, JsonArray target, Map<String, String> additionalUrls) {
- for (JsonElement lib : source) {
- JsonObject artifact = getElement(getElement(lib.getAsJsonObject(), "downloads").getAsJsonObject(), "artifact").getAsJsonObject();
- String path = getElement(artifact, "path").getAsString();
- if (additionalUrls.containsKey(path)) {
- artifact.getAsJsonObject().addProperty("url", additionalUrls.get(path));
- }
- target.add(lib);
- }
- }
-}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Main.java b/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Main.java
deleted file mode 100644
index 83ecdf959e..0000000000
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/converter/Main.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package io.github.zekerzhayard.forgewrapper.converter;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-
-public class Main {
- public static void main(String[] args) {
- Path installer = null, instance = Paths.get("."), multimc = null;
- try {
- HashMap<String, String> argsMap = parseArgs(args);
- installer = Paths.get(argsMap.get("--installer"));
- if (argsMap.containsKey("--instance")) {
- instance = Paths.get(argsMap.get("--instance"));
- multimc = instance.getParent();
- }
- } catch (Exception e) {
- System.out.println("Invalid arguments! Use: java -jar <ForgeWrapper.jar> --installer=<forge-installer.jar> [--instance=<instance-path>]");
- throw new RuntimeException(e);
- }
-
- try {
- URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {
- Converter.class.getProtectionDomain().getCodeSource().getLocation(),
- installer.toUri().toURL()
- }, null);
- ucl.loadClass("io.github.zekerzhayard.forgewrapper.converter.Converter").getMethod("convert", Path.class, Path.class, Path.class).invoke(null, installer, instance, multimc);
- System.out.println("Successfully install Forge for MultiMC!");
- } catch (Exception e) {
- System.out.println("Failed to install Forge!");
- throw new RuntimeException(e);
- }
- }
-
- /**
- * @return installer -- The path of forge installer.<br/>
- * instance -- The instance folder of MultiMC.<br/>
- * cursepack -- The version of cursepacklocator.<br/>
- */
- private static HashMap<String, String> parseArgs(String[] args) {
- HashMap<String, String> map = new HashMap<>();
- for (String arg : args) {
- String[] params = arg.split("=", 2);
- map.put(params[0], params[1]);
- }
- if (!map.containsKey("--installer")) {
- throw new IllegalArgumentException();
- }
- return map;
- }
-}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Bootstrap.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Bootstrap.java
new file mode 100644
index 0000000000..98e8dda209
--- /dev/null
+++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Bootstrap.java
@@ -0,0 +1,78 @@
+package io.github.zekerzhayard.forgewrapper.installer;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import io.github.zekerzhayard.forgewrapper.installer.util.ModuleUtil;
+
+public class Bootstrap {
+ public static void bootstrap(List<String> jvmArgs, String minecraftJar, String libraryDir) throws Throwable {
+ // Replace all placeholders
+ List<String> replacedJvmArgs = new ArrayList<>();
+ for (String arg : jvmArgs) {
+ replacedJvmArgs.add(arg.replace("${classpath}", System.getProperty("java.class.path").replace(File.separator, "/")).replace("${classpath_separator}", File.pathSeparator).replace("${library_directory}", libraryDir));
+ }
+ jvmArgs = replacedJvmArgs;
+
+ String modulePath = null;
+ List<String> addExports = new ArrayList<>();
+ List<String> addOpens = new ArrayList<>();
+ for (int i = 0; i < jvmArgs.size(); i++) {
+ String arg = jvmArgs.get(i);
+
+ if (arg.equals("-p") || arg.equals("--module-path")) {
+ modulePath = jvmArgs.get(i + 1);
+ } else if (arg.startsWith("--module-path=")) {
+ modulePath = arg.split("=", 2)[1];
+ }
+
+ if (arg.equals("--add-exports")) {
+ addExports.add(jvmArgs.get(i + 1));
+ } else if (arg.startsWith("--add-exports=")) {
+ addExports.add(arg.split("=", 2)[1]);
+ }
+
+ if (arg.equals("--add-opens")) {
+ addOpens.add(jvmArgs.get(i + 1));
+ } else if (arg.startsWith("--add-opens=")) {
+ addOpens.add(arg.split("=", 2)[1]);
+ }
+
+ // Java properties
+ if (arg.startsWith("-D")) {
+ String[] prop = arg.substring(2).split("=", 2);
+
+ if (prop[0].equals("ignoreList")) {
+ // The default ignoreList is too broad and may cause some problems, so we define it more precisely.
+ String[] ignores = (prop[1] + ",NewLaunch.jar,ForgeWrapper-," + minecraftJar).split(",");
+ List<String> ignoreList = new ArrayList<>();
+ for (String classPathName : System.getProperty("java.class.path").replace(File.separator, "/").split(File.pathSeparator)) {
+ Path classPath = Paths.get(classPathName);
+ String fileName = classPath.getFileName().toString();
+ if (Stream.of(ignores).anyMatch(fileName::contains)) {
+ String absolutePath = classPath.toAbsolutePath().toString();
+ if (absolutePath.contains(",")) {
+ absolutePath = absolutePath.substring(absolutePath.lastIndexOf(","));
+ }
+ ignoreList.add(absolutePath.replace(File.separator, "/"));
+ }
+ }
+ System.setProperty(prop[0], String.join(",", ignoreList));
+ } else {
+ System.setProperty(prop[0], prop[1]);
+ }
+ }
+ }
+
+ if (modulePath != null) {
+ ModuleUtil.addModules(modulePath);
+ }
+ ModuleUtil.addExports(addExports);
+ ModuleUtil.addOpens(addOpens);
+ ModuleUtil.setupBootstrapLauncher();
+ }
+}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java
index 78c2d5880c..99ead7cf31 100644
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java
+++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java
@@ -5,6 +5,7 @@ import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -13,13 +14,14 @@ import io.github.zekerzhayard.forgewrapper.installer.detector.DetectorLoader;
import io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector;
public class Main {
- public static void main(String[] args) throws Exception {
+ public static void main(String[] args) throws Throwable {
List<String> argsList = Stream.of(args).collect(Collectors.toList());
String mcVersion = argsList.get(argsList.indexOf("--fml.mcVersion") + 1);
String forgeVersion = argsList.get(argsList.indexOf("--fml.forgeVersion") + 1);
String forgeFullVersion = mcVersion + "-" + forgeVersion;
IFileDetector detector = DetectorLoader.loadDetector();
+ Bootstrap.bootstrap(detector.getJvmArgs(forgeFullVersion), detector.getMinecraftJar(mcVersion).getFileName().toString(), detector.getLibraryDir().toAbsolutePath().toString());
if (!detector.checkExtraFiles(forgeFullVersion)) {
System.out.println("Some extra libraries are missing! Run the installer to generate them now.");
@@ -47,7 +49,7 @@ public class Main {
}
}
- Launcher.main(args); // TODO: this will be broken in forge 1.17
+ Class.forName(detector.getMainClass(forgeFullVersion)).getMethod("main", String[].class).invoke(null, new Object[] { args });
}
// https://github.com/MinecraftForge/Installer/blob/fe18a164b5ebb15b5f8f33f6a149cc224f446dc2/src/main/java/net/minecraftforge/installer/actions/PostProcessors.java#L287-L303
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/MainV2.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/MainV2.java
deleted file mode 100644
index 230d9fbe28..0000000000
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/MainV2.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package io.github.zekerzhayard.forgewrapper.installer;
-
-import java.util.function.Consumer;
-
-// to support forge 1.17 (bootstraplauncher)
-public class MainV2 implements Consumer<String[]> {
- @Override
- public void accept(String[] args) {
- try {
- Main.main(args);
- } catch (Throwable t) {
- throw new RuntimeException(t);
- }
- }
-}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
index b81670840b..2f8c976985 100644
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
+++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
@@ -12,10 +12,15 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.util.AbstractMap;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
+import java.util.function.Function;
+import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
@@ -83,30 +88,53 @@ public interface IFileDetector {
/**
* @param forgeFullVersion Forge full version (e.g. 1.14.4-28.2.0).
+ * @return The list of jvm args.
+ */
+ default List<String> getJvmArgs(String forgeFullVersion) {
+ return this.getDataFromInstaller(forgeFullVersion, "version.json", e -> {
+ JsonElement element = getElement(e.getAsJsonObject().getAsJsonObject("arguments"), "jvm");
+ List<String> args = new ArrayList<>();
+ if (!element.equals(JsonNull.INSTANCE)) {
+ element.getAsJsonArray().iterator().forEachRemaining(je -> args.add(je.getAsString()));
+ }
+ return args;
+ });
+ }
+
+ /**
+ * @param forgeFullVersion Forge full version (e.g. 1.14.4-28.2.0).
+ * @return The main class.
+ */
+ default String getMainClass(String forgeFullVersion) {
+ return this.getDataFromInstaller(forgeFullVersion, "version.json", e -> e.getAsJsonObject().getAsJsonPrimitive("mainClass").getAsString());
+ }
+
+ /**
+ * @param forgeFullVersion Forge full version (e.g. 1.14.4-28.2.0).
* @return The json object in the-installer-jar-->install_profile.json-->data-->xxx-->client.
*/
default JsonObject getInstallProfileExtraData(String forgeFullVersion) {
+ return this.getDataFromInstaller(forgeFullVersion, "install_profile.json", e -> e.getAsJsonObject().getAsJsonObject("data"));
+ }
+
+ default <R> R getDataFromInstaller(String forgeFullVersion, String entry, Function<JsonElement, R> function) {
Path installer = this.getInstallerJar(forgeFullVersion);
if (isFile(installer)) {
try (ZipFile zf = new ZipFile(installer.toFile())) {
- ZipEntry ze = zf.getEntry("install_profile.json");
+ ZipEntry ze = zf.getEntry(entry);
if (ze != null) {
try (
InputStream is = zf.getInputStream(ze);
InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8)
) {
- for (Map.Entry<String, JsonElement> entry : new JsonParser().parse(isr).getAsJsonObject().entrySet()) {
- if (entry.getKey().equals("data")) {
- return entry.getValue().getAsJsonObject();
- }
- }
+ return function.apply(new JsonParser().parse(isr));
}
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
- throw new RuntimeException("Can't detect the forge installer!");
+ throw new RuntimeException("Unable to detect the forge installer!");
}
return null;
}
@@ -123,6 +151,7 @@ public interface IFileDetector {
Map<String, String> hashMap = new HashMap<>();
// Get all "data/<name>/client" elements.
+ Pattern artifactPattern = Pattern.compile("^\\[(?<groupId>[^:]*):(?<artifactId>[^:]*):(?<version>[^:@]*)(:(?<prefix>[^@]*))?(@(?<type>[^]]*))?]$");
for (Map.Entry<String, JsonElement> entry : jo.entrySet()) {
String clientStr = getElement(entry.getValue().getAsJsonObject(), "client").getAsString();
if (entry.getKey().endsWith("_SHA")) {
@@ -132,8 +161,7 @@ public interface IFileDetector {
hashMap.put(entry.getKey(), m.group("sha1"));
}
} else {
- Pattern p = Pattern.compile("^\\[(?<groupId>[^:]*):(?<artifactId>[^:]*):(?<version>[^:@]*)(:(?<prefix>[^@]*))?(@(?<type>[^]]*))?]$");
- Matcher m = p.matcher(clientStr);
+ Matcher m = artifactPattern.matcher(clientStr);
if (m.find()) {
String groupId = nullToDefault(m.group("groupId"), "");
String artifactId = nullToDefault(m.group("artifactId"), "");
@@ -152,7 +180,11 @@ public interface IFileDetector {
// Check all cached libraries.
boolean checked = true;
for (Map.Entry<String, Path> entry : libsMap.entrySet()) {
- checked = checked && this.checkExtraFile(entry.getValue(), hashMap.get(entry.getKey() + "_SHA"));
+ checked = this.checkExtraFile(entry.getValue(), hashMap.get(entry.getKey() + "_SHA"));
+ if (!checked) {
+ System.out.println("Missing: " + entry.getValue());
+ break;
+ }
}
return checked;
}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/util/ModuleUtil.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/util/ModuleUtil.java
new file mode 100644
index 0000000000..0b37945822
--- /dev/null
+++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/util/ModuleUtil.java
@@ -0,0 +1,21 @@
+package io.github.zekerzhayard.forgewrapper.installer.util;
+
+import java.util.List;
+
+public class ModuleUtil {
+ public static void addModules(String modulePath) {
+ // nothing to do with Java 8
+ }
+
+ public static void addExports(List<String> exports) {
+ // nothing to do with Java 8
+ }
+
+ public static void addOpens(List<String> opens) {
+ // nothing to do with Java 8
+ }
+
+ public static void setupBootstrapLauncher() {
+ // nothing to do with Java 8
+ }
+}
diff --git a/src/main/resources/META-INF/services/io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector b/src/main/resources/META-INF/services/io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector
index 44375f8732..31f2c4e711 100644
--- a/src/main/resources/META-INF/services/io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector
+++ b/src/main/resources/META-INF/services/io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector
@@ -1 +1 @@
-io.github.zekerzhayard.forgewrapper.installer.detector.MultiMCFileDetector \ No newline at end of file
+io.github.zekerzhayard.forgewrapper.installer.detector.MultiMCFileDetector
diff --git a/src/main/resources/META-INF/services/java.util.function.Consumer b/src/main/resources/META-INF/services/java.util.function.Consumer
deleted file mode 100644
index 64cc969425..0000000000
--- a/src/main/resources/META-INF/services/java.util.function.Consumer
+++ /dev/null
@@ -1 +0,0 @@
-io.github.zekerzhayard.forgewrapper.installer.MainV2 \ No newline at end of file
diff --git a/src/main/resources/mmc-pack.json b/src/main/resources/mmc-pack.json
deleted file mode 100644
index 3622087e0a..0000000000
--- a/src/main/resources/mmc-pack.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "formatVersion": 1,
- "components": [
- {
- "important": true,
- "uid": "net.minecraft",
- "version": "{VERSION}"
- },
- {
- "uid": "net.minecraftforge"
- }
- ]
-} \ No newline at end of file
diff --git a/src/main/resources/patches/net.minecraftforge.json b/src/main/resources/patches/net.minecraftforge.json
deleted file mode 100644
index d170dd25e8..0000000000
--- a/src/main/resources/patches/net.minecraftforge.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "formatVersion": 1,
- "mainClass": "io.github.zekerzhayard.forgewrapper.installer.Main",
- "minecraftArguments": "",
- "name": "Forge",
- "requires": [
- {
- "equals": "{VERSION}",
- "uid": "net.minecraft"
- }
- ],
- "type": "release",
- "uid": "net.minecraftforge",
- "version": "{FORGE_VERSION}",
- "mavenFiles": [
- {
- "name": "net.minecraftforge:forge:{VERSION}-{FORGE_VERSION}:installer",
- "url": "https://files.minecraftforge.net/maven/"
- }
- ],
- "libraries": [
- {
- "name": "io.github.zekerzhayard:ForgeWrapper:${version}",
- "MMC-hint": "local",
- "MMC-filename": "ForgeWrapper-${version}.jar"
- }
- ]
-} \ No newline at end of file