Added rooted dirt

This commit is contained in:
Dylan K. Taylor
2022-07-23 15:57:37 +01:00
parent bedf79e2cd
commit a7313ed9d9
11 changed files with 124 additions and 20 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\DirtType;
use pocketmine\event\block\BlockSpreadEvent;
use pocketmine\item\Item;
use pocketmine\math\Facing;
@ -51,7 +52,7 @@ class Mycelium extends Opaque{
$z = mt_rand($this->position->z - 1, $this->position->z + 1);
$world = $this->position->getWorld();
$block = $world->getBlockAt($x, $y, $z);
if($block instanceof Dirt && !$block->isCoarse()){
if($block instanceof Dirt && $block->getDirtType()->equals(DirtType::NORMAL())){
if($block->getSide(Facing::UP) instanceof Transparent){
$ev = new BlockSpreadEvent($block, $this, VanillaBlocks::MYCELIUM());
$ev->call();