From 70c5ff4da3ffdd40ab971265a629816165dfdd29 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Wed, 4 Jan 2023 21:17:55 +0100 Subject: [PATCH] Tried to fix potential race condition --- src/main/java/net/raphimc/viaproxy/ViaProxy.java | 2 ++ src/main/java/net/raphimc/viaproxy/cli/options/Options.java | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/raphimc/viaproxy/ViaProxy.java b/src/main/java/net/raphimc/viaproxy/ViaProxy.java index 89a6586..24f472f 100644 --- a/src/main/java/net/raphimc/viaproxy/ViaProxy.java +++ b/src/main/java/net/raphimc/viaproxy/ViaProxy.java @@ -13,6 +13,7 @@ import net.lenni0451.classtransform.utils.loader.InjectionClassLoader; import net.lenni0451.reflect.ClassLoaders; import net.raphimc.netminecraft.constants.MCPipeline; import net.raphimc.netminecraft.netty.connection.NetServer; +import net.raphimc.vialegacy.util.VersionEnum; import net.raphimc.viaproxy.cli.ConsoleHandler; import net.raphimc.viaproxy.cli.options.Options; import net.raphimc.viaproxy.plugins.PluginManager; @@ -46,6 +47,7 @@ public class ViaProxy { Logger.setup(); ConsoleHandler.hookConsole(); Logger.LOGGER.info("Initializing ViaProxy..."); + VersionEnum.init(); setNettyParameters(); MCPipeline.useOptimizedPipeline(); c2pChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); diff --git a/src/main/java/net/raphimc/viaproxy/cli/options/Options.java b/src/main/java/net/raphimc/viaproxy/cli/options/Options.java index d4001a4..0726669 100644 --- a/src/main/java/net/raphimc/viaproxy/cli/options/Options.java +++ b/src/main/java/net/raphimc/viaproxy/cli/options/Options.java @@ -28,8 +28,6 @@ public class Options { public static boolean BETACRAFT_AUTH; public static void parse(final String[] args) throws IOException { - VersionEnum.init(); // We need to init the version list already here - final OptionParser parser = new OptionParser(); final OptionSpec help = parser.acceptsAll(asList("help", "h", "?"), "Get a list of all arguments").forHelp();