mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3'
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user