diff options
author | Lulonaut <lulonaut@tutanota.de> | 2022-09-26 08:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 16:42:51 +1000 |
commit | 29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4 (patch) | |
tree | 28013b27de81c872683f36e4d68bbbf1de39b502 | |
parent | 1e71e3e515fc17034e2e73a9b5e6012637204453 (diff) | |
download | NotEnoughUpdates-29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4.tar.gz NotEnoughUpdates-29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4.tar.bz2 NotEnoughUpdates-29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4.zip |
Fix TextTabOverlay crash (#308)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java index 03578c95..fa263db7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java @@ -49,8 +49,13 @@ public abstract class TextTabOverlay extends TextOverlay { public void realTick() { shouldUpdateOverlay = shouldUpdate(); if (shouldUpdateOverlay) { - boolean currentTabState = - Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); + int keycode = Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode(); + boolean currentTabState; + if (keycode > 0) { + currentTabState = Keyboard.isKeyDown(keycode); + } else { + currentTabState = false; + } if (lastTabState != currentTabState) { lastTabState = currentTabState; update(); |