Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3'

This commit is contained in:
Dylan K. Taylor
2020-04-18 17:33:05 +01:00
76 changed files with 286 additions and 238 deletions

View File

@ -69,7 +69,7 @@ class Sapling extends Flowable{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($item instanceof Fertilizer){
Tree::growTree($this->pos->getWorld(), $this->pos->x, $this->pos->y, $this->pos->z, new Random(mt_rand()), $this->treeType);
Tree::growTree($this->pos->getWorldNonNull(), $this->pos->x, $this->pos->y, $this->pos->z, new Random(mt_rand()), $this->treeType);
$item->pop();
@ -81,7 +81,7 @@ class Sapling extends Flowable{
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->isTransparent()){
$this->pos->getWorld()->useBreakOn($this->pos);
$this->pos->getWorldNonNull()->useBreakOn($this->pos);
}
}
@ -90,12 +90,12 @@ class Sapling extends Flowable{
}
public function onRandomTick() : void{
if($this->pos->getWorld()->getFullLightAt($this->pos->x, $this->pos->y, $this->pos->z) >= 8 and mt_rand(1, 7) === 1){
if($this->pos->getWorldNonNull()->getFullLightAt($this->pos->x, $this->pos->y, $this->pos->z) >= 8 and mt_rand(1, 7) === 1){
if($this->ready){
Tree::growTree($this->pos->getWorld(), $this->pos->x, $this->pos->y, $this->pos->z, new Random(mt_rand()), $this->treeType);
Tree::growTree($this->pos->getWorldNonNull(), $this->pos->x, $this->pos->y, $this->pos->z, new Random(mt_rand()), $this->treeType);
}else{
$this->ready = true;
$this->pos->getWorld()->setBlock($this->pos, $this);
$this->pos->getWorldNonNull()->setBlock($this->pos, $this);
}
}
}