color = DyeColor::WHITE(); parent::__construct($idInfo, $name, $typeInfo); } public function onNearbyBlockChange() : void{ if(($water = $this->getAdjacentWater()) !== null){ $ev = new BlockFormEvent($this, VanillaBlocks::CONCRETE()->setColor($this->color), $water); $ev->call(); if(!$ev->isCancelled()){ $this->position->getWorld()->setBlock($this->position, $ev->getNewState()); } }else{ $this->startFalling(); } } public function tickFalling() : ?Block{ if($this->getAdjacentWater() === null){ return null; } return VanillaBlocks::CONCRETE()->setColor($this->color); } private function getAdjacentWater() : ?Water{ foreach(Facing::ALL as $i){ if($i === Facing::DOWN){ continue; } $block = $this->getSide($i); if($block instanceof Water){ return $block; } } return null; } }