Commit Graph

1146 Commits

Author SHA1 Message Date
Dylan K. Taylor
f29e2f7110 WorldProviders now accept Loggers 2023-05-02 15:41:11 +01:00
Dylan K. Taylor
d0d263191d Fix build 2023-05-02 14:21:33 +01:00
Dylan K. Taylor
3366e1084b LightUpdate: squeeze 10-15% more performance out of propagation
we can use SubChunkExplorerStatus to decide whether or not to update the local light array reference.

We also dereference some properties into local variables, because dereferencing properties is slow. Indirect property dereferences add an extra performance penalty for every layer.
2023-05-02 14:05:55 +01:00
Dylan K. Taylor
d0b9234841 SkyLightUpdate: deal with effective light during initial node discovery
this allows the propagation stage to ignore effective light, which allows for further optimisations.
2023-05-01 22:29:31 +01:00
Dylan K. Taylor
d80f65ae7c BedrockWorldData: do not load worlds with a newer NetworkVersion than we support
often, protocol updates are done without consideration for the current world format version. We don't want to require the world support to be updated at the same time, since this might delay updates.
2023-05-01 17:53:08 +01:00
Dylan K. Taylor
096daef0d0 World: added setDisplayName()
this is an obvious use case, and I'm not really sure why it wasn't supported sooner.
2023-05-01 16:29:07 +01:00
Dylan K. Taylor
b3e94ef1dc Chunk: update documentation 2023-05-01 14:46:30 +01:00
Dylan T
07dc10d6e6 World: improve performance of tickChunks() selection process (#5721)
Since light population is required to make a chunk tickable, a chunk may not be tickable for some time if the async workers get backlogged.
The previous version of this system only cached the eligibility result if the result was a "yes", but we can also track it when it's a "no", rather than rechecking it every tick.

This change should improve performance in factions and similar gamemodes, which involve large maps with sparsely distributed players, where each player likely has an independent, non-overlapping ticking chunk circle.

We also ditch TickingChunkEntry in favour of multiple arrays to track the eligibility states. This allows us to avoid rechecking the (even cached) readiness of potentially thousands of chunks. If there are no ticking chunks to recheck, this reduces the cost of the selection process to zero.
2023-04-27 16:59:29 +01:00
Dylan K. Taylor
a8dec1adb1 PM5-specific changes for 1.19.80 2023-04-26 23:30:56 +01:00
Dylan K. Taylor
0dca85af44 Merge branch 'minor-next' into major-next 2023-04-26 23:28:27 +01:00
Dylan K. Taylor
9bfcd39f2a World: improve type info for getTickingChunks() 2023-04-26 17:06:52 +01:00
Dylan K. Taylor
8102616ff4 Added ticking chunk count to /status
closes #5716
2023-04-26 17:05:31 +01:00
Dylan K. Taylor
6c0ad9589b Block: rename isSameType() to hasSameTypeId()
this should remove any ambiguity about its behaviour.
2023-04-21 20:25:21 +01:00
Dylan K. Taylor
1026811741 Merge branch 'minor-next' into major-next 2023-04-14 21:00:08 +01:00
Dylan K. Taylor
e48a4aaa55 World: fixed chunk ticking not being disabled by setting chunk ticking radius to 0
I can't believe I missed this ...
2023-04-14 16:02:28 +01:00
Dylan K. Taylor
6cace51a21 Remove unused variable 2023-04-13 12:47:17 +01:00
Dylan K. Taylor
6703f46a08 Remove random dead TODOs 2023-04-13 12:47:08 +01:00
Dylan K. Taylor
c3a2199f0e Reduce global usage in world providers 2023-04-13 12:05:37 +01:00
Dylan K. Taylor
b80d7a57e3 Merge branch 'minor-next' into major-next 2023-04-11 23:56:28 +01:00
Dylan K. Taylor
ba62e0f9cb WorldManager: fixed borked pre-generation for new worlds' spawn terrain
perhaps directly altering the behaviour of selectChunks() wasn't a good
idea? ...
2023-04-11 23:55:53 +01:00
Dylan K. Taylor
ed88d68fd7 Remove stuff deprecated in 4.19.0 2023-04-11 23:20:58 +01:00
Dylan K. Taylor
9bddcc72f7 Merge branch 'minor-next' into major-next 2023-04-11 22:51:50 +01:00
Dylan K. Taylor
ad88490e84 Mark TickingChunkEntry as internal 2023-04-11 22:34:11 +01:00
Dylan T
946c2fbacc Ticking chunks rewrite (#5689)
This API is much more flexible than the old, allowing any arbitrary set of chunks to be ticked.

These changes also improve the performance of random chunk ticking by almost entirely eliminating the cost of chunk selection. Ticking chunks are now reevaluated when a player moves, instead of every tick.

The system also does not attempt to check the same chunks twice, leading to further improvements.

Overall, the overhead of random chunk selection is reduced anywhere from 80-96%. In practice, this can offer a 5-10% performance gain for servers with sparsely distributed players.
2023-04-11 20:01:19 +01:00
Dylan K. Taylor
a0dadc6e37 Merge branch 'minor-next' into major-next 2023-04-10 14:38:23 +01:00
Dylan K. Taylor
b2f755720d Use a proper Breakdown timing group instead of the unwieldy INCLUDED_BY_OTHER_TIMINGS_PREFIX 2023-04-05 20:47:47 +01:00
Dylan K. Taylor
abd4ef01eb Merge branch 'minor-next' into major-next 2023-03-15 23:02:41 +00:00
Dylan K. Taylor
337a254768 Use NetworkBroadcastUtils for broadcasting packets
this eradicates all but 4 usages of Server in Entity, which is extremely cool.
2023-03-15 22:28:51 +00:00
Dylan K. Taylor
4ba4d556ed Tidy up world version related things
I decided to scrap the max schema ID stuff, since it just adds extra places to forget updating. Instead, it's better to use minor version locks and version metadata, as we do for BedrockData and BedrockProtocol.
2023-03-14 23:27:16 +00:00
Dylan K. Taylor
777b4d6ac3 PM5-specific updates for 1.19.70 2023-03-14 18:50:04 +00:00
Dylan K. Taylor
8933064cd5 Fixed missing blockstate upgrader 2023-03-06 17:02:33 +00:00
Dylan K. Taylor
737a63b0a3 Merge branch 'next-minor' into next-major 2023-02-21 18:33:03 +00:00
Dylan K. Taylor
75bb4f8da6 Merge branch 'stable' into next-minor 2023-02-21 18:32:58 +00:00
Dylan K. Taylor
efdd7a186d World: fixed population timer sometimes not being stopped 2023-02-21 18:31:33 +00:00
Dylan K. Taylor
2f12bb9943 Merge branch 'next-minor' into next-major 2023-02-06 12:34:57 +00:00
alvin0319
981385cf4a GeneratorManager: Removed redundant Closure wrapping (#5551) 2023-02-04 14:04:31 +00:00
Dylan K. Taylor
da5302ca86 BlockStateData: introduce and use current() 2023-02-02 16:21:50 +00:00
Dylan K. Taylor
6b7a4e2c41 Split up ItemDataUpgrader (preparing for code backport) 2023-02-02 16:08:49 +00:00
Dylan K. Taylor
e9b994cbc3 Allow limiting max schema ID loaded for item ID upgrading 2023-02-02 15:29:45 +00:00
Dylan K. Taylor
0e15a8698a BlockStateUpgrader: do not use blockstate version to manage internal schemas
these are no longer reliable.
2023-02-01 22:35:59 +00:00
Dylan K. Taylor
2b987b450b always the CS... 2023-01-26 14:58:32 +00:00
Dylan K. Taylor
f56339c306 Fix build 2023-01-26 14:48:43 +00:00
Dylan K. Taylor
0a3ecfdae9 Clean up terminology around block state IDs and their handling 2023-01-25 19:01:15 +00:00
Dylan K. Taylor
cbaff1caec BlockPlaceEvent: use BlockTransaction, closes #1760
BlockPlaceEvent no longer extends BlockEvent, since it's now a multi-block event
getBlockReplaced() is removed
getTransaction() is added

to be honest, BlockPlaceEvent should be something like PlayerBlockPlaceEvent...
2023-01-24 15:49:42 +00:00
Dylan K. Taylor
7314151c47 LevelDB: code cleanup 2023-01-17 22:47:43 +00:00
Dylan K. Taylor
7abfc46567 First look at 3D biome support 2023-01-17 21:41:30 +00:00
Dylan K. Taylor
5c2ed210fc Merge branch 'next-minor' into next-major 2023-01-14 20:53:41 +00:00
Dylan K. Taylor
7d59bafd83 World: added requestSafeSpawn() (async)
this simplifies usages of safe spawns, since the caller doesn't need to know which chunks will be needed for the spawn to be selected.

We'll need this in the future, because safe spawns may also get diverted horizontally as well as vertically, which might require loading adjacent chunks as well as the chunk the position is actually in.
2023-01-14 17:42:17 +00:00
Dylan K. Taylor
0132ff47cb Merge branch 'next-minor' into next-major 2023-01-13 17:46:35 +00:00
Dylan K. Taylor
2ed48c8469 ... 2023-01-13 17:46:16 +00:00