Commit Graph
6 Commits
Author SHA1 Message Date
Martijn a9122ec448 Do crystal-portal proximity check before entity lookup (#9611) 2023-08-26 22:23:31 +02:00
Martijn 86a90ebe3e Optimize nearest structure border iteration (#9638) 2023-08-23 03:53:42 +02:00
Martijn a925383693 Count down radius-aware dependency tree node parents (#9600) 2023-08-18 04:02:20 +02:00
Martijn 90cdec2283 Fix chunk sending when the computed time overflows (#8833) 2023-02-09 18:27:24 +01:00
Martijn Muijsers cdc3b28062 Do crystal-portal proximity check before entity lookup
This adds a very cheap distance check when an end crystal is placed.

Attempting to respawn the dragon, which involves looking up the end crystal
entities near the portal, every time an end crystal is placed, can be slow on
some servers that have players placing end crystals as a style of combat.

The very cheap distance check prevents running the entity lookup every time.
2023-08-15 21:04:55 +02:00
Martijn Muijsers badf809fef Optimize nearest structure border iteration
Getting the nearest generated structure contains a nested set of loops that
iterates over all chunks at a specific chessboard distance. It does this by
iterating over the entire square of chunks within that distance, and checking
if the coordinates are at exactly the right distance to be on the border.

This patch optimizes the iteration by only iterating over the border chunks.
This evaluated chunks are the same, and in the same order, as before, to
ensure that the returned found structure (which may for example be a buried
treasure that will be marked on a treasure map) is the same as in vanilla.
2023-08-21 21:05:09 +02:00