Prospector's Journal

Prospector's Journal

162 Downloads

Bags crash

CanisArtorus opened this issue ยท 5 comments

commented

Track down how the bag inventory / container implementation is unstable.

commented

Report 1:
Tritanium alloy box (size = 55)
when clicking in the player inventory section.
crash caused by: ArrayList out of bounds error. index 71, size 45.

With a stack of notebooks, that was shoved into hand from end of hotbar on opening the box.

commented

Report3:
a Meteorite box (size=28)
index 62, size 45

Report 3a:
The Leather bag (size = 6) did not crash, but did not do anything, when clicking on any slot whatsoever.

commented

all crashes quote Container (source file:206 func_75144_a; or source file:191 func_75144_a).
The only unsafe ArrayList a.get(int i) in that class is at detectAndSendChanges() :
for(int i =0; i< this.inventorySlots.size(); i++) {
this.inventoryItemStacks.get(i)

This is inconsistent with size 45; only 36 player inventory slots (and one is locked) are ever added.
How could the variable number of other slots be getting added wrong?

... The entirety of Container.SlotClick is in a try/catch !
How does this crash?

commented

Report 2:
Same Tritanium Alloy box (size = 55)
On r-click a stack of rocks on the hotbar.
crash caused by: ArrayList index out of bounds. index 89 size 45.

Conclusion: Index is being given as container slot.
the player inventory (+hotbar + crafting grid) is size 45.

commented

report 4:
an Iron box (size =22), shift-clicking a rock on the second to last hotbar slot
Index 56, size 45. Container.func_75144_a (line 191).
Is definitely the slot in container index being checked...