
[1.10] Conduits on chunk borders ghostload adjacent chunks
fnuecke opened this issue ยท 5 comments
Issue Description:
When conduits are on a chunk border, they will ghostload their neighboring chunk. In particular, if there are two conduits crossing a chunk border, those chunks will not get unloaded because the conduits keep each other loaded.
What you expected to happen:
No ghostloading.
Steps to reproduce:
- Create an empty, superflat world. Teleport somewhere far away from spawn.
- Find a chunk border, place two (energy, didn't test others) conduits across the border, i.e. one conduit in the one chunk, the other in the other (but with the conduits connected).
- Teleport somewhere far, far away from that again.
- Use whatever means you have to see the chunks and the conduits are still loaded.
Remarks
I noticed this while debugging a bug in my mod, and saw updates happening while the chunk should have been unloaded. A breakpoint in readFromNBT showed the trace of the load originating in ConduitUtil.getConduit. Unless there's a good reason for the ghostloading, a simple
TileEntity te = world.isBlockLoaded(pos) ? world.getTileEntity(pos) : null;
there would probably do the trick.
I re-tested this with only EIO in a new, superflat world in standalone vanilla (by attaching the debugger and checking the world state via a random breakpoint in the world update).
When saving (opening the menu in singleplayer, didn't test in multiplayer) the chunks do get unloaded, though. So maybe it's not that bad, but still, wanted to make sure you're aware of this.
Affected Versions (Do not use "latest"):
- EnderIO: 3.1.171
- EnderCore: 0.4.1.65-beta
- Minecraft: 1.10.2
- Forge: 12.18.3.2239
This is intended. Otherwise you'd get half-loaded conduit networks that can behave in a way that may be very unexpected for the user. Simple example:
Chunk 1:
- Ore processing facility
- Item Conduit extracting from it
- Trashcan at prio -1000
Chunk 2:
- Storage facility
- Conduit inserting into it
If we'd allow the partial conduit network in chunk 1 to work when chunk 2 is unloaded, the user wouldn't be very happy about all their stuff being voided.
However, if you find a case where a conduit loads a chunk for a neighbor block that is not a conduit, please report it. I already added about a thousand isBlockLoaded()s, but I may still have missed one.
BTW: markDirty() also loads neighboring chunks. As does setBlockState().
so just to get it right, i chunkload one single chunk with item transfer from time to time and driving conduits through a series of other chunks will then load them also whenever an item is transferred?
just to be sure, this sounds like a cheat somehow and was an acknowledged bug in the past verison for 1.7.10 and also if the chunkloading is not persistent, this could lead to heavy chunkloading while nobody is there, leading to low server tick.
No, it will not "nicely" load those chunks "on demand", it will access and load them every time a conduit network does something. That's the way multi-block structures have always worked: Either they access unloaded chunks all the time or they break horribly (remember BuildCraft explosions?)...
Allright, thought that might be the case. Fair enough then, conduit networks can get pretty sprawly, so disabling the whole network because a part isn't loaded would probably do more harm than good.
Thanks for the quick reply!