diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java index 056f457a..a07d08d3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java @@ -17,16 +17,18 @@ import pro.gravit.launcher.AutogenConfig; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.modules.LauncherModulesManager; import pro.gravit.launcher.modules.Module; import pro.gravit.launcher.modules.ModulesManager; import pro.gravit.launchserver.asm.ClassMetadataReader; import pro.gravit.launchserver.asm.SafeClassWriter; public class JAConfigurator { - private static final String modulesManagerName = Type.getInternalName(ModulesManager.class); - private static final String launcherName = Type.getInternalName(Launcher.class); - private static final String modulesManagerDesc = Type.getDescriptor(ModulesManager.class); - private static final String registerModDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(Module.class)); + private static final String modulesManagerName = "pro/gravit/launcher/client/ClientModulesManager"; + private static final String launcherName = "pro/gravit/launcher/LauncherEngine"; + private static final String modulesManagerDesc = "Lpro/gravit/launcher/client/ClientModulesManager;"; + private static final String registerModDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(LauncherModule.class)); private static final String autoGenConfigName = Type.getInternalName(AutogenConfig.class); private static final String stringDesc = Type.getDescriptor(String.class); private final ClassNode configclass; @@ -47,7 +49,7 @@ public void addModuleClass(String fullName) { initModuleMethod.instructions.add(new FieldInsnNode(Opcodes.GETSTATIC, launcherName, "modulesManager", modulesManagerDesc)); initModuleMethod.instructions.add(new TypeInsnNode(Opcodes.NEW, fullName.replace('.', '/'))); initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, fullName.replace('.', '/'), "", "()V")); - initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, modulesManagerName, "registerModule", registerModDesc)); + initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, modulesManagerName, "loadModule", registerModDesc)); } public byte[] getBytecode(ClassMetadataReader reader) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index 6005399f..c0fb76a8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -441,6 +441,7 @@ public static void main(String... args) throws Throwable { //Launcher.modulesManager = new ClientModuleManager(engine); LauncherEngine.modulesManager = new ClientModuleManager(); LauncherConfig.getAutogenConfig().initModules(); //INIT + LauncherEngine.modulesManager.initModules(null); initGson(LauncherEngine.modulesManager); //Launcher.modulesManager.preInitModules(); LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase());