bravoserver / bravo

UNMAINTAINED: Reverse-engineered Minecraft stuff. Worked with 1.4.x protocol
http://bravoserver.org/
Other
206 stars 45 forks source link

Crafting Tables crashes Minecraft 1.6.6 client. #302

Closed somasis closed 13 years ago

somasis commented 13 years ago

Hi, when I try to use a crafting table, as soon as a click an item so I can bring it over to the actual crafting 3x3 board, my client crashes. From the console output, it appears that the server does not crash.

uname -a: Linux convergence 2.6.38-ARCH #1 SMP PREEMPT Tue May 3 07:40:34 CEST 2011 x86_64 Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz GenuineIntel GNU/Linux

My config: http://pastebin.com/xTNV87wM Bravo's Output: http://pastebin.com/ezFG1Pd6

I'm running Minecraft 1.6.6 as the client, and I assume Bravo is working fine with it... Tell me if I'm incorrect. :-)

gtaylor commented 13 years ago

Was this a new world or an existing Notchian world?

Also, what item did you click, and does it happen for all item types or just one in particular?

somasis commented 13 years ago

This was a world that I copied from my 1.6.6 client, and it does it on all items.

MostAwesomeDude commented 13 years ago

I can't get a crash, but I certainly get a client lockup. Curious.

somasis commented 13 years ago

Yeah, the screen turns black if you wait long enough too. (at least for me)

pincy commented 13 years ago

I've got the same issue with a world created by bravo and with an imported world. Server: 2ghz single core, 1gb ram, vps

MostAwesomeDude commented 13 years ago

This is a client bug and more investigation will be needed. :T

MostAwesomeDude commented 13 years ago

The client gets an OOB at index 45 (zero-indexed) for some sort of table. With some help, we determined that this is corresponding to Bravo's view of workbenches as containing 46 slots total, and apparently the Notchian client must believe that there are less than 46 slots on a workbench.

EntityReborn commented 13 years ago

My guess (and we mentioned this on IRC, just pasting it here for posterity) is that the output of the crafting table isn't in said slots, making the list 45 items long. I don't read obfuscated code very well, so I can't read the java to be sure.

And 9 + 27 + 9 is 45. Wonder where the crafting output went. :3
mcsakoff commented 13 years ago

See my pull request. I've fixed that. Problem was in Window items (0x68) message. For workbench it was sent with wid == 0. That is not right. Client expects inventory update but the message have an extra item in the collection. As a result: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322)

MostAwesomeDude commented 13 years ago

Closing as fixed.