mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
World: skip random block ticking on chunks that don't have any light
typically this is a state that only lasts for a tick or so, but it's a race condition that is regardless very commonly encountered. If you were very unlucky, you might have noticed grass randomly dying when you were spawning or flying around, even though it was in full sky light.
This commit is contained in:
@@ -894,6 +894,9 @@ class World implements ChunkManager{
|
||||
$dz = mt_rand(-$randRange, $randRange);
|
||||
$hash = World::chunkHash($dx + $chunkX, $dz + $chunkZ);
|
||||
if(!isset($chunkTickList[$hash]) and isset($this->chunks[$hash])){
|
||||
if(!$this->chunks[$hash]->isLightPopulated()){
|
||||
continue;
|
||||
}
|
||||
//check adjacent chunks are loaded
|
||||
for($cx = -1; $cx <= 1; ++$cx){
|
||||
for($cz = -1; $cz <= 1; ++$cz){
|
||||
|
Reference in New Issue
Block a user