Mojira Archive
MC-137059

Aggressive chunk unloading causing problems in the end and nether

With the new changes to chunk unloading in 1.13.1 by removing the ability for chunks to skip the unload process comes a few problems. Specifically talking about the ability to skip the save to disk process of chunks that have been ticked.

Villages for example can tick an unloaded chunk and reload it. In the overworld this is great as it can be helpful to reload chunks that players want to keep loaded. The village mechanic itself isn't a problem at all as a village can't keep itself permanently loaded without player means. But the main problems are found when building a village in the nether or the end. There is a specific line of code in PlayerChunkMap.java that causes a dimension to unload all its chunks every game tick if there are no players in the dimension.

if (this.players.isEmpty())
 {
 WorldProvider worldprovider = this.theWorldServer.provider;
if (!worldprovider.canRespawnHere())
 {
 this.theWorldServer.getChunkProvider().unloadAllChunks();
 }
 }

The code applies to all dimensions except for overworld. In 1.13.0 and lower version a chunk that ticked would remove the schedule chunks from being saved and combined with hoppers and villages players could control specific chunks from unloading. But with the changes villages now reload an unloaded chunk every other game tick as chunks no longer have the ability to skip being saved. This causes 600 reads and writes within a minute before the village destroys itself as after 1200 game ticks the village would unload without any villagers nearby.

Given Village loading is the only remaining chunk loading in 1.13.1 its safe to say that it might become harmful as many village chunk loading setups are built in the nether and end causing issues when players leave the dimensions.

The unloading code in PlayerChunkMap seams odd as there are already checks in place to stop all dimension specific activity after 300 game ticks making this extremely aggressive unloading process redundant. Specifically talking about updateEntityTick in WorldServer.java

public void updateEntities()
 {
 if (this.playerEntities.isEmpty())
 {
 if (this.updateEntityTick++ >= 300)
 {
 return;
 }
 }
 else
 {
 this.resetUpdateEntityTick();
 }
this.provider.onWorldUpdateEntities();
 super.updateEntities();
 }

After 300 game ticks all entities stop ticking and stop all activities in the dimension and with autosaves able to clean up all remaining chunks that are loaded.

Given village chunk loading is the last resort to remote chunk loading it would be a shame to see it removed. But the PlayerChunkMap unloading would probably help both performance and gameplay alike if it was removed.

Awaiting Response

Xcom6000

2018-09-26, 05:25 PM

2020-10-13, 10:31 AM

2020-10-13, 10:31 AM

0

2

Plausible

Performance

Minecraft 1.13.1

-