Occultism

Occultism

19M Downloads

Stable wormhole permanently unlinks itself from storage actuator if that is not loaded

TheRealWormbo opened this issue ยท 1 comments

commented

Describe the bug
A stable wormhole, that was previously linked to a Dimensional Storage Actuator, unlinks itself if the storage actuator is in an unloaded chunk while the wormhole attempts to access it. This unlinking is not temporary and will not fix itself just by loading the Dimensional Storage Actuator again.

To Reproduce
Steps to reproduce the behavior:

  1. Place a Dimensional Storage Actuator outside the spawn chunks (e.g. teleport 1000 blocks away after creating a new world)
  2. Link a stable wormhole to that.
  3. Place the wormhole several chunks away from storage, point a hopper into it and let it drain e.g. a double chest of random items into the wormhole. The hopper will only ever contain a single item while the transfer is ongoing.
  4. Walk/fly away in the opposite direction of where the storage is, so storage gets unloaded before the wormhole, until both are out of render distance. Low render/simulation distance helps here.
  5. Walk/fly back to the wormhole. It is now unlinked and items instead accumulate in the hopper.

Expected behavior
Unlinking from the storage is expected while the storage chunk is not loaded. However, upon reloading that chunk, the link should be reestablished automatically, since this is a common scenario when traveling around the periphery of one's base.

Screenshots
The test setup I used right after setting it up. The drawer contains a creative vending upgrade for convenience, but a filled double chest also works for this test.
Initial setup

After leaving and returning to that location, the wormhole is visibly unlinked and items pile up in the hopper.
After returning to it

System (please complete the following information):

  • Occultism Version: 1.18.2-1.36.6
  • OS: Linux Mint 20.3 Cinnamon (likely not relevant to the issue)
  • Minecraft Version: 1.18.2
  • Modpack Link and Version, or list of mods: The Phoenix's Magics and Goodies v1.4

Additional context
From a look at the code it seems like the wormhole only tests whether it's doing the link check on a server, not whether the target location is actually in a loaded chunk. The block entity of the storage actuator does not exists while it is not in a loaded chunk, so the wormhole clears its linked location and replaces itself with an unlinked version.

commented

Good point - this seems to be the result of the changes to how block entities are accessed and me not having the downstream consequences in mind at the time.

Going to add special handling for unloaded chunks