Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> getData(File librariesDir) {
public static Map<String, Object> getData(File librariesDir, boolean skipHashCheck) {
Map<String, Object> 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));
Expand Down Expand Up @@ -79,15 +79,20 @@ private static List<String> getExtraLibraries(Version0 version) {
public static class InstallV1Wrapper extends InstallV1 {
protected Map<String, List<Processor>> 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<Processor> getProcessors(String side) {
if (this.skipHashCheck){
return new ArrayList<>();
}
List<Processor> processor = this.processors.get(side);
if (processor == null) {
checkProcessorFiles(processor = super.getProcessors(side), super.getData("client".equals(side)), this.librariesDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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<String, Object> data = (Map<String, Object>) installer.getMethod("getData", File.class).invoke(null, detector.getLibraryDir().toFile());
Map<String, Object> data = (Map<String, Object>) 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) {
Expand Down
Loading