From 2beca5f91f8da0b16910e7720788eacf385e03db Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Mon, 13 Feb 2023 16:22:43 -0800 Subject: v1.1.0 release (trolling) --- .../malwarefight/nosession/relaunch/Relaunch.java | 34 ++++++++-------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'src/main/java/gq/malwarefight/nosession/relaunch') diff --git a/src/main/java/gq/malwarefight/nosession/relaunch/Relaunch.java b/src/main/java/gq/malwarefight/nosession/relaunch/Relaunch.java index e712254..d1a240c 100644 --- a/src/main/java/gq/malwarefight/nosession/relaunch/Relaunch.java +++ b/src/main/java/gq/malwarefight/nosession/relaunch/Relaunch.java @@ -2,17 +2,6 @@ package gq.malwarefight.nosession.relaunch; import gq.malwarefight.nosession.tweaks.cleanup.CleanupTweaker; import gq.malwarefight.nosession.utils.Utils; -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.fml.client.FMLClientHandler; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModAPIManager; -import net.minecraftforge.fml.common.asm.ASMTransformerWrapper; -import net.minecraftforge.fml.common.registry.ItemStackHolderInjector; -import net.minecraftforge.fml.common.registry.ObjectHolderRegistry; -import net.minecraftforge.fml.relauncher.FMLInjectionData; -import net.minecraftforge.fml.relauncher.FMLLaunchHandler; - -import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -22,9 +11,18 @@ import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import net.minecraft.launchwrapper.Launch; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.ModAPIManager; +import net.minecraftforge.fml.common.asm.ASMTransformerWrapper; +import net.minecraftforge.fml.common.registry.ItemStackHolderInjector; +import net.minecraftforge.fml.common.registry.ObjectHolderRegistry; +import net.minecraftforge.fml.relauncher.FMLInjectionData; +import net.minecraftforge.fml.relauncher.FMLLaunchHandler; public class Relaunch { - public static void relaunch(ArrayList args, File gameDir, File assetsDir, String version) throws Exception { + public static void relaunch(ArrayList args) throws Exception { resetSecurityManager(); setToNull(FMLLaunchHandler.class, "INSTANCE"); setToNull(Loader.class, "instance"); @@ -36,18 +34,10 @@ public class Relaunch { Utils.setStaticValue(FMLInjectionData.class, "containers", new ArrayList()); resetTransformerWrapper(); addSelfToClassloader(); - Class innerLaunch = Launch.class; - Method launch = innerLaunch.getDeclaredMethod("main", String[].class); - launch.invoke(null, (Object) constructArgs(args, gameDir, assetsDir, version)); + Launch.main(constructArgs(args)); } - private static String[] constructArgs(ArrayList initial, File gameDir, File assetDir, String version) { - initial.add("--version"); - initial.add(version); - initial.add("--gameDir"); - initial.add(gameDir.getAbsolutePath()); - initial.add("--assetsDir"); - initial.add(assetDir.getAbsolutePath()); + private static String[] constructArgs(ArrayList initial) { initial.add("--tweakClass"); initial.add(CleanupTweaker.class.getName()); return initial.toArray(new String[0]); -- cgit