Applied Energistics 2

Applied Energistics 2

137M Downloads

Spatial Storage breaks chest+storage bus when you teleport together with the SCS Area

LuckyTeran opened this issue ยท 3 comments

commented

Describe the bug
When you store a little Network with a chest+storage bus as storage the chest "breaks" and not longer works with the storage bus.

To Reproduce
Build a small Network in the overworld consisting of:

  • Controller
  • Creative Energy Cell
  • Spatial IO Port + Button + Spatial Cell
  • Spatial Pylons (SCS size doesn't seem to matter)

Inside the SCS area build the following:

  • Controller
  • Creative Energy Cell
  • ME Crafting Terminal
  • Storage Bus + Chest connected to controller

Put something in the chest. Get inside the SCS Area and trigger the Spatial IO Port with redstone. You get teleported with the mini network into the Spatial Storage Dimension. Open the chest (no sound plays) everything is still there. Check the terminal, no items are shown. Breaking and rebuilding parts of the network won't fix it. Breaking and setting down the chest again "fixes" the bug. Now put items into the chest and use "/ae2 spatial tpback" to go back to the overworld. Trigger the Spatial IO Port and bring back the network+chest. Check the terminal, Items are shown. Trigger the Spatial IO Port again to send the chest into the storage dimension without teleporting with it. Use "/ae2 spatial tp 1" to teleport into the storage dimension. Check the Terminal, Items are shown.

Expected behavior
Teleporting together with the SCS Area should not "break" the chest and Items should still be accessible via the network.

Additional context
Could not test with barrels because they are not teleported into the storage dimension and i wanted to reproduce the bug with default config and with no additional datapacks.
No errors are reported in debug.log or any other log file. Found this bug while playing with my custom mod pack. Removed every mod until only AE2 and JEI were left and could still trigger the bug. To make sure tested with a clean install of minecraft+forge. While testing, the bug showed up with other combinations but i could only trigger it reliable with the steps above.

Environment
Singleplayer/Multiplayer
F3+C crashlog: https://pastebin.com/LYcuA0vU

commented

Looks like the way Forge patched vanilla chests makes it impossible to move them around. If there is not way to notify it about the move, we probably have to remove vanilla chests from the whitelist.

commented

Maybe it is not obvious in the wall of text (sorry) but the chest only breaks when you teleport together with the chest and the network inside the SCS area.
Sending the chest+network without teleporting with it and using "/ae2 spatial tp 1" does not break it and it works as expected.
Sending and bringing back the chest without teleporting also does not trigger the bug and the chest still works.

To me it seems like teleporting inside the SCS area and using "/ae2 spatial tp 1" somehow are different in how they work.

commented

That is more how forge handles it. Being directly teleported keeps the chest tile entity around with its old state, which seems to use the position of the previous location to access the actual storage. Using the command takes some time, so the chunks are unloaded and then a fresh chest is created once the player enters.

Which is one reason we whitelist tileentities and not allow everything. Machines are really not designed to be moved around without encountering some issues. Like in this case as worst case it could easily try to access the old location to store changes, which it cannot and suddenly allows to dupe anything inside the chest as changes are never saved.