Ensure NetworkConstants is loaded before mod construction (#10448)

This commit is contained in:
Jonathing authored and GitHub committed 2025-02-18 14:16:07 -08:00
1 parent dfe1f9240c
commit fd1b206cf2
3 files changed
+11 -2

No files matched your search

@@ -433,7 +433,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());
@@ -46,6 +46,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;