mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +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:
parent
a68b0b1f93
commit
2e45398072
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user