Returns timestamp of current chunk snapshot. Store this timestamp to use in removeSnapshotUser
called at the end of tick
returned value isNull if chunk is not loaded/added
Returns writeable copy of current chunk snapshot. Any changes made to it must be reported trough onBlockChanges method. This buffer is valid until commit. After commit this buffer becomes next immutable snapshot. Returns null if chunk is not added and/or not loaded.
Call this whenewer changes to write buffer are done. Those changes will be passed to chunkChangesHandlers to be handled when sendChanges is called.
Internal. Called by code which loads chunks from storage.
Internal. Called by code which saves chunks to storage.
Generic removal of snapshot user. Removes chunk if numUsers == 0. Use this to remove added snapshot user. Use timestamp returned from addCurrentSnapshotUser.
Performs save of all modified chunks. Modified chunks are those that were committed. Perform save right after commit.
Send changes to clients
Sets number of users of chunk at cwp. If total chunk users if greater than zero, then chunk is loaded, if equal to zero, chunk will be unloaded.