Fix early logs being written to wrong backend
This commit is contained in:
parent
c7aafad507
commit
165cad8e6b
|
@ -36,7 +36,7 @@ public class CliMain {
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
LauncherEnv.checkClassLoaderState();
|
||||
LauncherEnv.initialize(new CliEnvBackend());
|
||||
|
||||
CommandResolution command = resolve(args);
|
||||
if (command.command().enableLog()) {
|
||||
|
@ -44,7 +44,6 @@ public class CliMain {
|
|||
Utils.LOGGER.info("Loading from " + MetaHolder.BASE_PATH);
|
||||
}
|
||||
|
||||
LauncherEnv.initialize(new CliEnvBackend());
|
||||
try {
|
||||
command.invoke();
|
||||
} finally {
|
||||
|
|
|
@ -41,7 +41,6 @@ public class GuiMain {
|
|||
private static String glslVersion = null;
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
LauncherEnv.checkClassLoaderState();
|
||||
LauncherEnv.initialize(new GuiEnvBackend());
|
||||
Utils.LOGGER.info("Launching Inceptum v" + BuildMetadata.VERSION);
|
||||
Utils.LOGGER.info("Loading from " + MetaHolder.BASE_PATH);
|
||||
|
|
|
@ -19,13 +19,11 @@ import java.util.function.Consumer;
|
|||
public class LauncherEnv {
|
||||
private static EnvBackend backend;
|
||||
|
||||
public static void checkClassLoaderState() {
|
||||
public static void initialize(EnvBackend backend) throws IOException {
|
||||
if (MetaHolder.class.getClassLoader() != LauncherEnv.class.getClassLoader()) {
|
||||
throw new IllegalStateException("Mismatching classloader between two classes. Something is wrong here");
|
||||
}
|
||||
}
|
||||
|
||||
public static void initialize(EnvBackend backend) throws IOException {
|
||||
LauncherEnv.backend = backend;
|
||||
|
||||
GsonHolder.registerTypeAdapter(MinecraftArgument.class, new MinecraftArgumentDeserializer());
|
||||
|
|
Loading…
Reference in New Issue