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

@ -49,13 +49,13 @@ class Mycelium extends Opaque{
$x = mt_rand($this->pos->x - 1, $this->pos->x + 1);
$y = mt_rand($this->pos->y - 2, $this->pos->y + 2);
$z = mt_rand($this->pos->z - 1, $this->pos->z + 1);
$block = $this->pos->getWorld()->getBlockAt($x, $y, $z);
$block = $this->pos->getWorldNonNull()->getBlockAt($x, $y, $z);
if($block->getId() === BlockLegacyIds::DIRT){
if($block->getSide(Facing::UP) instanceof Transparent){
$ev = new BlockSpreadEvent($block, $this, VanillaBlocks::MYCELIUM());
$ev->call();
if(!$ev->isCancelled()){
$this->pos->getWorld()->setBlock($block->pos, $ev->getNewState());
$this->pos->getWorldNonNull()->setBlock($block->pos, $ev->getNewState());
}
}
}