Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor
2022-07-20 20:55:33 +01:00
40 changed files with 189 additions and 136 deletions

View File

@ -91,12 +91,13 @@ class Sapling extends Flowable{
}
public function onRandomTick() : void{
if($this->position->getWorld()->getFullLightAt($this->position->getFloorX(), $this->position->getFloorY(), $this->position->getFloorZ()) >= 8 && mt_rand(1, 7) === 1){
$world = $this->position->getWorld();
if($world->getFullLightAt($this->position->getFloorX(), $this->position->getFloorY(), $this->position->getFloorZ()) >= 8 && mt_rand(1, 7) === 1){
if($this->ready){
$this->grow(null);
}else{
$this->ready = true;
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
}
}
}