diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Installer.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Installer.java index 10895b1..75af2de 100644 --- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Installer.java +++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Installer.java @@ -24,16 +24,16 @@ public class Installer { private static InstallV1Wrapper wrapper; - private static InstallV1Wrapper getWrapper(File librariesDir) { + private static InstallV1Wrapper getWrapper(File librariesDir, boolean skipHashCheck) { if (wrapper == null) { - wrapper = new InstallV1Wrapper(Util.loadInstallProfile(), librariesDir); + wrapper = new InstallV1Wrapper(Util.loadInstallProfile(), librariesDir, skipHashCheck); } return wrapper; } - public static Map getData(File librariesDir) { + public static Map getData(File librariesDir, boolean skipHashCheck) { Map data = new HashMap<>(); - Version0 version = Version0.loadVersion(getWrapper(librariesDir)); + Version0 version = Version0.loadVersion(getWrapper(librariesDir, skipHashCheck)); data.put("mainClass", version.getMainClass()); data.put("jvmArgs", version.getArguments().getJvm()); data.put("extraLibraries", getExtraLibraries(version)); @@ -79,15 +79,20 @@ private static List getExtraLibraries(Version0 version) { public static class InstallV1Wrapper extends InstallV1 { protected Map> processors = new HashMap<>(); protected File librariesDir; + protected boolean skipHashCheck = false; - public InstallV1Wrapper(InstallV1 v1, File librariesDir) { + public InstallV1Wrapper(InstallV1 v1, File librariesDir, boolean skipHashCheck) { super(v1); this.serverJarPath = v1.getServerJarPath(); this.librariesDir = librariesDir; + this.skipHashCheck = skipHashCheck; } @Override public List getProcessors(String side) { + if (this.skipHashCheck){ + return new ArrayList<>(); + } List processor = this.processors.get(side); if (processor == null) { checkProcessorFiles(processor = super.getProcessors(side), super.getData("client".equals(side)), this.librariesDir); 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 f15a2a8..c90e8b9 100644 --- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java +++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/Main.java @@ -24,6 +24,7 @@ public static void main(String[] args) throws Throwable { // NOTE: this is only true for NeoForge versions past 20.2.x // early versions of NeoForge (for 1.20.1) are not supposed to be covered here boolean isNeoForge = argsList.contains("--fml.neoForgeVersion"); + boolean skipHashCheck = argsList.contains("--skipHashCheck"); String mcVersion = argsList.get(argsList.indexOf("--fml.mcVersion") + 1); String forgeGroup = argsList.contains("--fml.forgeGroup") ? argsList.get(argsList.indexOf("--fml.forgeGroup") + 1) : "net.neoforged"; @@ -52,7 +53,7 @@ public static void main(String[] args) throws Throwable { }, ModuleUtil.getPlatformClassLoader())) { Class installer = ucl.loadClass("io.github.zekerzhayard.forgewrapper.installer.Installer"); - Map data = (Map) installer.getMethod("getData", File.class).invoke(null, detector.getLibraryDir().toFile()); + Map data = (Map) installer.getMethod("getData", File.class, boolean.class).invoke(null, detector.getLibraryDir().toFile(), skipHashCheck); try { Bootstrap.bootstrap((String[]) data.get("jvmArgs"), detector.getMinecraftJar(mcVersion).getFileName().toString(), detector.getLibraryDir().toAbsolutePath().toString()); } catch (Throwable t) {