Ensure NetworkConstants is loaded before mod construction (#10407)

This commit is contained in:
Jonathing authored and GitHub committed 2025-02-06 10:49:59 -08:00
1 parent 59979642e9
commit fa109380f7
3 files changed
+11 -2

No files matched your search

@@ -426,7 +426,6 @@ public class ForgeMod
return uuid.toString();
});
LOGGER.debug(FORGEMOD, "Loading Network data for FML net version: {}", NetworkConstants.init());
CrashReportCallables.registerCrashCallable("FML", ForgeVersion::getSpec);
CrashReportCallables.registerCrashCallable("Forge", ()->ForgeVersion.getGroup()+":"+ForgeVersion.getVersion());
@@ -47,6 +47,11 @@ public class NetworkHooks
{
private static final Logger LOGGER = LogManager.getLogger();
public static void init()
{
LOGGER.debug("Loading Network data for FML net version: {}", NetworkConstants.init());
}
public static String getFMLVersion(final String ip)
{
return ip.contains("\0") ? Objects.equals(ip.split("\0")[1], NetworkConstants.NETVERSION) ? NetworkConstants.NETVERSION : ip.split("\0")[1] : NetworkConstants.NOVERSION;