Wesley1808 / ServerCore

A mod that aims to optimize the minecraft server.
75 stars 11 forks source link

Prevent sync fluid loads #46

Closed KernelFreeze closed 2 years ago

KernelFreeze commented 2 years ago

Hello! I added a new Mixin that prevents sync loads of chunks when an entity ticks (checking if its inside a fluid). This is specially useful when a player joins a world, because it starts ticking immediately and causes cascading lag. We tested this patch on a production server for a few months, and it successfully works as intended, decreasing lag without causing further issues.

I found the need for this Mixin using a profiler, this accounts for a large usage of the server tick time.

Wesley1808 commented 2 years ago

This doesn't really fix the issue. Player ticks will require the chunks to be loaded in many other places than that, and skipping those can be dangerous (such as, but not limited to falling through the world given the right conditions). Doing this just shifts the issue to the next part of the player tick that requires chunks to be loaded - https://spark.lucko.me/wGkWR37njc.

There are already proper solutions for this specific issue though: VMP (Very Many Players) provides async chunk loading for players on login, and when going through nether portals. ServerCore has a configurable option to prevent players from moving into unloaded chunks.

KernelFreeze commented 2 years ago

Oh, well, closing the pull request in that case.