Make sure NEI plugins are loaded before processing keybindings (#375)

NEI plugins are initialized in a separate thread. If this takes too long,
the client tick handler might already be running checking the keybindings
in KeyManager while a plugin calls API.addKeyBind() which can lead to a
CME.

Reported in https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/13292
Thanks to @Denostrov for helping me track this down.
This commit is contained in:
Wilhelm Schuster authored and GitHub committed 2023-05-05 21:01:50 +02:00
1 parent 5eeb001534
commit 30c87e9160
2 files changed
+10 -3

No files matched your search

@@ -472,8 +472,6 @@ public class NEIClientConfig {
NEIController.load();
RecipeCatalysts.loadCatalystInfo();
configLoaded = true;
new Thread("NEI Plugin Loader") {
@Override
@@ -496,6 +494,7 @@ public class NEIClientConfig {
}
MinecraftForge.EVENT_BUS.post(new NEIConfigsLoadedEvent());
configLoaded = true;
}
}.start();
ItemSorter.loadConfig();
@@ -597,6 +596,10 @@ public class NEIClientConfig {
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
}
public static boolean isLoaded() {
return configLoaded;
}
public static boolean loadHandlersFromJar() {
return !getBooleanSetting("tools.handler_load_from_config");
}