Applied Energistics 2

Applied Energistics 2

156M Downloads

Quantum Network Bridge breaks on Chunk unloading/loading

bibo38 opened this issue ยท 1 comments

commented

Describe the bug

Used latest commit on the 7.x-1.15 branch: d6cbfe2

After setting up a Quantum Network Bridge to connect two ME networks, the connection breaks if the chunk is
unloaded/loaded caused by travelling far away from the ME system.

To Reproduce

  1. Checkout the above commit.
  2. Start Minecraft via ./gradlew runClient
  3. Create a test world (creative mode in my case, gamerule dodaylightcycle = false)
  4. Teleport far away from the Spawnpoint: /tp 10000 128 -10000 (i think because the spawnpoint is never unloaded)
  5. Reduce your Render Distance in the settings to the lowest value (2) to reduce the distance necessary to unload chunks
  6. Setup a simple Quantum Network Bridge setup:
    Simple network with two quantum link chambers
  7. Insert an item into the ME System and check, that you can see it in both ME Crafting terminals.
  8. Fly away about 300 blocks on the x or z axis (x axis in my case) to unload the chunk, then turn around and fly back
  9. Now only the ME Crafting terminal with the ME Drive (left side in my image) shows the item. The other ME Crafting terminal (on the right side in my case) doesn't show any item, as it is no longer connected to the other ME System
  10. Take out both Quantum Entangled singulatities from the Quantum Link Chambers and then put them back in
  11. Now both terminals display the items again => Both ME Networks are connected again
  12. goto step 8.

Expected behavior

Even when unloading/loading the chunk, the connection should be kept or be restored, but not break.

Additional context

Originally discovered in 1.12 with some more setup (a security terminal was necessary in 1.12 and different players, so that the quantum link chamber had a different PlayerID than the Security terminal. Upon leaving the chunk, the security system noticed, that a secure Node should be connected to an insecureNode, but since the insecureNode had another PlayerId, the security check failed causing the disconnect). The relevant lines for the security related bug in 1.12 were:

if (!a_isSecure && b_isSecure) {
return checkPlayerPermissions(b.getGrid(), a.getPlayerID());
}
if (a_isSecure && !b_isSecure) {
return checkPlayerPermissions(a.getGrid(), b.getPlayerID());
}

As 1.12 isn't supported anymore, I've tried to reproduce this bug in 1.15 and noticed, that unloading/loading the chunk was sufficient to break the connection in 1.15. Maybe the security issue still exists in 1.15, if the basic reconnection without a Security Terminal is fixed.

Environment

  • Environment:
    • Arch Linux
    • Git 2.28.0
    • OpenJDK 1.8.0_265 64-bit
    • Minecraft 1.15.2
    • Forge 31.2.31
    • MCP 20200515.085601
    • tested with the whole setup being in the same chunk
commented

So, this is now fixed in the HEAD for 1.16.1 with PR for 1.15 pending. This particular issue was actually related to a porting bug. isChunkLoaded will return false while isBlockLoaded will return true. isChunkLoaded seems to additionally check if entities already started ticking for the chunk (if I understand it right), while our QNB initialization runs before that.