Quantum Network Bridge breaks on Chunk unloading/loading
bibo38 opened this issue ยท 1 comments
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
- Checkout the above commit.
- Start Minecraft via
./gradlew runClient
- Create a test world (creative mode in my case, gamerule dodaylightcycle = false)
- Teleport far away from the Spawnpoint:
/tp 10000 128 -10000
(i think because the spawnpoint is never unloaded) - Reduce your Render Distance in the settings to the lowest value (2) to reduce the distance necessary to unload chunks
- Setup a simple Quantum Network Bridge setup:
- Insert an item into the ME System and check, that you can see it in both ME Crafting terminals.
- 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
- 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
- Take out both Quantum Entangled singulatities from the Quantum Link Chambers and then put them back in
- Now both terminals display the items again => Both ME Networks are connected again
- 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:
Applied-Energistics-2/src/main/java/appeng/util/Platform.java
Lines 952 to 958 in 12ca8d1
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
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.