private void BeginEntityAdded(IChunkedEntity entity) | Runs when an entity joins the chunk. Starts spawning it for every player in the chunk, if the chunk is loaded. |
private void BeginEntityRemoved(IChunkedEntity entity) | Runs when an entity leaves the chunk. Despawns it for players who don't also have its new chunk loaded. |
private void LoadForPlayer(Player player) | Runs when a player is added to the chunk. Starts spawning its entities for them, and tells them it loaded if the chunk auto-syncs. |
private void OnChunkLoaded(Chunk chunk) | Runs when the chunk's content loads. Allows loading and starts syncing for players already in the chunk. |
private void OnChunkUnloaded(Chunk chunk) | Runs when the chunk's content unloads. Stops new entities from being spawned for players. |
private void StartSync(Player player, bool isSpawning) | Starts a gradual spawn or despawn of the chunk's entities for one player. Global chunks finish it straight away. |
private void StopSync(Player player) | Stops and forgets any sync running for the player. |
private void SyncFinished(ChunkSync sync) | Callback when a player's gradual sync ends. Raises ReadyForUnload if nothing keeps the chunk loaded. |
private void UnloadForPlayer(Player player) | Runs when a player is removed from the chunk. Tells them it unloaded and starts despawning its entities for them. |