Container inventory populated with duplicate items
Chest block inventory space gets populated with a duplicate of the hot bar inventory.
This happens when:
- I create a world
- put the chest blocks in the world
- exit the world
- access the block
- If I access the items in the inventory space the game sometimes crashes (see attached crash log)
Comments (16)
-
reporter -
repo owner Could you show your block, tile entity and gui file?
-
reporter - attached temp.rar
Block, TE and GUI files attached.
Some more information: (addendum to step 4 in repro steps)
You may need to access multiple blocks. The inventory may display normally when activating the first block. Second block shows some corruption, then third block shows even more. Alternating back and forth sometimes adds an extra row of inventory.
SOMETIMES this has resulted in actual item duplication, Or it might crash. I have also crashed even just accessing a block even if it doesn't have corrupted inventory. (this was on a world that I put ordinary chest blocks, the 'alchemical chest' and 'condenser', exited and re-entered then accessed block. Neither of those does anything unusual with the tile entities or inventories)
-
repo owner Could you just upload the whole mod? It would make everything alot easier for me.
-
reporter - attached EE2R.rar
I made some changes in it while trying to track this down. My earlier assumptions about what's triggering this were wrong. (about it only happening if I wrote data to the tile entity). I've commented out all events other than onActivated so it shouldn't be running any other scripts from those events. Also changed onActivated so it's only trying to open the GUI.
Currently when I try to test, the bug seems to manifest immediately. GUI doesn't open and inventory gets corrupted.
-
repo owner There is a error in your mod.js file. You use "57:0" for mod.addCreativeTab() but you should only use a id for the second argument. I'm not able to reproduce this bug, everything works as intented. Maybe I've already fixed that. I'll release an update in the next minutes. Try this update and tell me if it still happen.
-
reporter Thanks for pointing the error out to me, I forgot that the itemBlock object that I was loading there was using strings. However that particular line would get called exactly once, if there isn't already a config file with the item ID I wanted. I guess I never actually tested what would happen if I was running it 'for the first time.'
However, with regards to the inventory corruption / crashing bug, I am still experiencing it with 10.1. I've tried updating Forge, I'm currently on Forge build 702 (for 1.5.2)
What versions of Minecraft and Forge did you test with?
-
repo owner I test with build 685 for 1.5.2.
-
repo owner Okay, I updated my setup to build 710 and now I get this bug on the server.
-
reporter So maybe it's a Forge bug relating to how they deal with inventory array indices. Looking at the error, it seems like the index offset is off by 1 when it crashes. i.e. index 127 on a size 127 inventory array would definitely be out of bounds . Those array sizes by the way correspond exactly to the total size of the chest + player inventory (including hotbar) every time I've checked.
-
reporter Just tried falling back to build 685 but it didn't help.
Although I consider this to be a bug there's clearly something in my mod that I've done to trigger this because shortly after I filed this ticket I tried creating a new barebones mod that does nothing more than add a chest block (tile entity type chestblock) with multiple blocks using meta but couldn't replicate the problem.
-
repo owner Okay, I may have fixed this issue but you have to replace all existing blocks to make them work.
-
reporter I assume you mean in the next release, right?
-
repo owner Right.
-
reporter Downloaded PR2, looks like this is fixed.
-
repo owner - changed status to resolved
- Log in to comment
More information: It's only happening to blocks whose tile entities I've written data to.
Example:
onPlacedByPlayer[6] = "world.setTileEntityIntData(position, 'storedEMC', 0); mod.loadScript('updateRelayNeighbors.js');";
(the script updateRelayNeighbors() also saves data to the tile entity)