Skip to content

Commit

Permalink
split bootstrap into constructor and init
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Oct 16, 2024
1 parent 2c7106f commit 59a4c96
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name=OneConfig
mod_id=oneconfig
version_major=1
version_minor=0
version_patch=0-alpha.27
version_patch=0-alpha.28

polyfrost.defaults.loom=3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,27 @@

package org.polyfrost.oneconfig.internal.bootstrap;

import net.minecraft.launchwrapper.Launch;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Bootstrap {
public static void init() {
//#if FORGE && MODERN==0
private org.polyfrost.oneconfig.internal.legacy.OneConfigTweaker tweaker = new org.polyfrost.oneconfig.internal.legacy.OneConfigTweaker();
//#endif

public void init() {
//#if FORGE && MODERN==0
new org.polyfrost.oneconfig.internal.legacy.OneConfigTweaker().injectIntoClassLoader(net.minecraft.launchwrapper.Launch.classLoader);
Map<String, String> launchArgs = ((Map<String, String>) Launch.blackboard.get("launchArgs"));
List<String> args = new ArrayList<>();
for (Map.Entry<String, String> entry : launchArgs.entrySet()) {
args.add(entry.getKey());
args.add(entry.getValue());
}
tweaker.acceptOptions(args, Launch.minecraftHome, Launch.assetsDir, launchArgs.get("--version"));
tweaker.injectIntoClassLoader(net.minecraft.launchwrapper.Launch.classLoader);
//#endif
}
}

0 comments on commit 59a4c96

Please sign in to comment.