Commit Graph

4 Commits

Author SHA1 Message Date
Spottedleaf 308d1ca5dc Update to latest paper 1.19 2023-06-07 15:32:55 -07:00
Spottedleaf ce49776448 Add more debugging information to chunk sending
Perform thread checks on the chunk send and warn when the
world is mismatched. I suspect that the world mismatches for
an unknown reason, but need to confirm it to chase it down.
2023-04-17 15:37:16 -07:00
Spottedleaf 25e0cbdae4 Rework some parts of the player chunk loader
Change overview:
- Rework limiting
- Remove mid tick updates
- Introduce consistency checks

The old limiting logic used an intervalled counter, but
did not account for possible slight changes in mid tick
invoke rate as it relied heavily on mid-tick logic. Due to
the removal of mid tick updates, it is now important that
the logic functions correctly no matter what rate it is invoked
at. The new logic directly tracks the last update time and
allocates an amount based proportional on the rate targetted,
which makes the logic call rate independent.

The removal of mid tick updates is done to eliminate recursive
call risk, and to additionally reduce the lock pressure on the
chunk system by grouping chunk loads onto one part of the tick
rather than spreading it out. The limiting rework should ensure
that this does not negatively affect rates, but it will decrease
the perceived smoothness of chunk generation/loading at low rates.

Introduce more consistency checks such as correct tick thread
and ticking-after-removal checks. Also, perform checks during the player
chunk loader tick to avoid updating potentially removed
players during the tick.
The checks are primarily made to try to hunt down a bug that
is causing the player chunk loader to double send a chunk
to a player.
2023-04-10 17:51:21 -07:00
Spottedleaf 76b06a1260 Do not call getGameTime when portalling Villagers
The code to stop all brain tasks is required to pass the current
game time to the tasks it stops. But, when a villager is being
portalled, the copied entity does not have any running tasks. So,
we can simply return early before invoking getGameTime if there
are no running tasks.

Fixes https://github.com/PaperMC/Folia/issues/23
2023-03-31 20:48:20 -07:00