mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
cache some Loader.isModLoaded calls (#72)
This commit is contained in:
1 parent
131cdd6e6b
commit
531e33765e
3 files changed
+10
-12
No files matched your search
@@ -51,6 +51,7 @@ public class ArmorControls {
|
||||
// boolean onStilts = false;
|
||||
|
||||
private final KeyBinding[] keys;
|
||||
private boolean isNotEnoughKeysLoaded;
|
||||
|
||||
public ArmorControls() {
|
||||
getVanillaKeyBindings();
|
||||
@@ -64,7 +65,8 @@ public class ArmorControls {
|
||||
ClientRegistry.registerKeyBinding(key);
|
||||
}
|
||||
}
|
||||
if (Loader.isModLoaded("notenoughkeys")) {
|
||||
isNotEnoughKeysLoaded = Loader.isModLoaded("notenoughkeys");
|
||||
if (isNotEnoughKeysLoaded) {
|
||||
Api.registerMod(TConstruct.modID, keyDescs);
|
||||
}
|
||||
// Add mc keys
|
||||
@@ -80,7 +82,7 @@ public class ArmorControls {
|
||||
|
||||
@SubscribeEvent
|
||||
public void keyEvent(KeyInputEvent event) {
|
||||
if (!Loader.isModLoaded("notenoughkeys")) {
|
||||
if (!isNotEnoughKeysLoaded) {
|
||||
checkAndPerformKeyActions(null, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user