Separate TickingChunkLoader from ChunkLoader

this makes it possible to keep chunks loaded without ticking them.
This commit is contained in:
Dylan K. Taylor
2021-03-18 23:19:27 +00:00
parent d1387ebd0a
commit c092a2e836
6 changed files with 54 additions and 14 deletions

View File

@ -951,6 +951,10 @@ class World implements ChunkManager{
$randRange = (int) ($randRange > $this->chunkTickRadius ? $this->chunkTickRadius : $randRange);
foreach($this->loaders as $loader){
if(!($loader instanceof TickingChunkLoader)){
//TODO: maybe we should just not track non-ticking chunk loaders here?
continue;
}
$chunkX = (int) floor($loader->getX()) >> 4;
$chunkZ = (int) floor($loader->getZ()) >> 4;