ChunkTracking

Global bookkeeper for storing:

  • which chunks is a specific player tracking?

  • which players are tracked by a specific chunk?

Tracking will happen automatically; simply call the relevant methods to access the data. The API is thread-safe, returning copies of the data rather than live views.

Functions

Link copied to clipboard
fun trackedChunkPos(player: Player): Collection<IVec2>

Gets all chunk positions tracked by a player.

Link copied to clipboard
fun trackedChunks(player: Player): List<@NotNull Chunk>

Gets all chunks tracked by a player.

Link copied to clipboard
fun trackedPlayers(chunk: Chunk): Collection<Player>

Gets all players tracked by a chunk.

fun trackedPlayers(world: World, worldPos: DVec3): Collection<Player>

Gets all players tracked by a chunk at a specified world position.

fun trackedPlayers(world: World, chunkPos: IVec2): Collection<Player>

Gets all players tracked by a chunk at a specified chunk position.