client crash
0uti opened this issue ยท 7 comments
@kenzierocks No that's the versions that can cause this crash (I think openeye does it like that)
This is the same as #478 although it was said to be unreproducible.
Can't think what it would be, not item damage because it happens when listed in the creative inventory (GuiContainerCreative) which is a controlled item stack.
Maybe it was caused by an update from 1.6 -> 1.7? @0uti is this an old world updated or a new world?
Found the reason for this error. Yay!
It's a very simple boolean logic issue; the AND function has a higher precedence than the OR function.
In terms of this crash, it is in items.scala:237
stack.hasTagCompound
was being ANDed with Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)
THEN ORed with Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)
So like
Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) && stack.hasTagCompound))
To fix, simply place brackets around correctly
if ((Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)||Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) && stack.hasTagCompound)
@0uti OK. Out of pure random messing I was able to reproduce this error. Now time to find the cause.
Edit
Found 2 ways to reproduce this crash
- In creative inventory hold shift and click on the Search Items tab
- Again in the creative inventory, in the Search Items textbox, type an upper-case letter (i.e. press shift + letter)
Fixed via aa3e05c