aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLulonaut <lulonaut@tutanota.de>2022-09-26 08:42:51 +0200
committerGitHub <noreply@github.com>2022-09-26 16:42:51 +1000
commit29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4 (patch)
tree28013b27de81c872683f36e4d68bbbf1de39b502
parent1e71e3e515fc17034e2e73a9b5e6012637204453 (diff)
downloadNotEnoughUpdates-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.java9
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();