Commit Graph

12 Commits

Author SHA1 Message Date
Spottedleaf
30d90b4700 Make raids thread-safe
We don't need to worry about synchronisation for saving data,
as that is currently only done by the shutdown thread - after
all regions stop ticking.
2023-02-28 06:33:34 -08:00
Spottedleaf
5a4351d3b6 Improve thread-safety of combat tracker
The simple solution is that we ignore entities/positions that are not
in the current region. Making retrieval of items in inventory
thread-safe is not going to happen.
2023-02-24 00:23:10 -08:00
Spottedleaf
9b824e6406 Fix player chunk loader behaving poorly when limits are low
Need to use ceil() so that it always allows at least 1 addition
for the 50ms case.
2023-02-24 00:03:00 -08:00
Spottedleaf
b772012778 Make the StructureCheck class MT-Safe
This is so that it may be accessed concurrently
from many regions.

Additionally, make sure it does not leak memory by limiting
the number of entries it will cache.
2023-02-23 23:35:30 -08:00
Spottedleaf
6d922d4b48 Implement player sleep status / night skip
Now, all of the sleep status changes are pushed to the global
tick thread. Had to modify the wake up all players routine
to use the task scheduler to ensure the player is woken up
on the right region context.

Fix erroring while crashing on the global tick thread due to
region field being null.
2023-02-23 20:48:49 -08:00
Spottedleaf
2474482685 Remove the remains of per-player mob spawns
Now, the spawning should be running Vanilla logic; except
that it is calculated per region (which is what per player
was effectively achieving anyways).
2023-02-23 20:07:56 -08:00
Spottedleaf
256f68d149 Regionise skip hopper event fields 2023-02-23 19:34:00 -08:00
Spottedleaf
fd7901d0f1 Implement TPA system for test server
Will be removed later once this is all public.

Fixed many issues with teleporting players on vehicles
while in the same region.

Additionaly, make sure dead players are dismounted - as
this logic was previously done by remove.

Re-add regiontodo.txt
2023-02-23 18:42:20 -08:00
Spottedleaf
fa05f7830c Implement BlockEntity#updateTicks
Because game time is now on the global tick thread, we no longer
need adjustments for any block entity. But, just in case we do
updateTicks functions now.
2023-02-23 12:52:39 -08:00
Spottedleaf
5f6b82862f Make BlockEntity#IGNORE_TILE_UPDATES a thread local
Ensures regions do not step over each other
2023-02-23 12:33:43 -08:00
Spottedleaf
18cac6b26e Use Folia comments in threaded regions patch
Other patches planned to be rebased
2023-02-23 08:35:07 -08:00
Spottedleaf
62c1166ee5 Initial commit 2023-02-23 08:13:45 -08:00