Open LemADEC opened 8 years ago
What key did you try to set things to? It looks like one part has decided the key exists and another part doesn't know what to do.
The default sorting key from InventoryTweaks overlaps with NEI/JEI key to see recipes, namely R. That key is also triggered when entering search patterns in inventory view which is annoying, so I've the habit to affect it to a "NONE" key. On 1.7.10 and before, I was using the "<" key (right of the shift key on fr keyboard layout). For 1.10, minecraft recognize that key, so I've tried to use the "²" key (above the tab key on fr keyboard layout).
Unfortunately due to the way input for the sorting is being handled, it probably won't like getting keys that aren't recognized by the mapping that games them names.
'Fixing' this would probably (I need to read up on how LWJGL handles non-US/UK layout keys) require some large changes to how I'm reading the input, so at least for the short term, I recommend not assigning any key that reads 'NONE' to sorting.
It was working in 1.7.10. Did something change in vanilla to cause this regression? Could we force the key configuration to something else and prevent the crash? Maybe just add a try-catch around the call for now?
Well, you did say the key you used changed -- it's possible (likely) that the <> key is in a 'valid' range, but the 'squared' key isn't for some reason.
Since you said the older one is 'recognized' now Mojang probably did update LWJGL in between versions.
Are we sure it's not some concurrent access issue since the mod is checking its shortcuts continuously in the option menu?
same: https://paste.dimdev.org/murumaliyo.mccrash
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:540)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:407)
at invtweaks.InvTweaks.isSortingShortcutDown(InvTweaks.java:978)
Pretty sure the mod is no longer supposed to directly call lwjgl. There's a higher call to make in minecraft code base to handle more than basic keys.
yeah, is there a reason this mod doesn't use the Forge KeyBinding
Api instead of calling lwjgl directly?
Because it predates forge stuff. Also IIRC the forge thing had some side-effects that weren't great related to something or other, there's an old PR that never got accepted to forge around that.
(e: see https://github.com/MinecraftForge/FML/pull/435 for some of the concerns around that back when this stuff was fairly new)
Using Forge 1.10.2-12.18.1.2077 and InventoryTweaks-1.61-58, client crashes when changing keyboard controls: