mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -04:00
Fix: Add a check to the index
This fixes some mods like galacticraft trying to get unexisting keyboard keys
This commit is contained in:
parent
804d349b2e
commit
b98c012c29
@ -393,9 +393,10 @@ public class Keyboard {
|
||||
* @return true if the key is down according to the last poll()
|
||||
*/
|
||||
public static boolean isKeyDown(int key) {
|
||||
if (!created)
|
||||
throw new IllegalStateException("Keyboard must be created before you can query key state");
|
||||
return keyDownBuffer.get(key) != 0;
|
||||
if (!created)
|
||||
throw new IllegalStateException("Keyboard must be created before you can query key state");
|
||||
if(key >= KEYBOARD_SIZE) return false;
|
||||
return keyDownBuffer.get(key) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user