*/ private function getAdjacentBlocksExceptDown() : \Generator{ foreach(Facing::ALL as $side){ if($side === Facing::DOWN){ continue; } yield $this->getSide($side); } } protected function checkForHarden() : bool{ if($this->falling){ return false; } foreach($this->getAdjacentBlocksExceptDown() as $colliding){ if($colliding instanceof Water){ if($this->decay === 0){ $this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN()); return true; }elseif($this->decay <= 4){ $this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE()); return true; } } } if($this->getSide(Facing::DOWN)->getTypeId() === BlockTypeIds::SOUL_SOIL){ foreach($this->getAdjacentBlocksExceptDown() as $colliding){ if($colliding->getTypeId() === BlockTypeIds::BLUE_ICE){ $this->liquidCollide($colliding, VanillaBlocks::BASALT()); return true; } } } return false; } protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{ if($block instanceof Water){ $block->liquidCollide($this, VanillaBlocks::STONE()); }else{ parent::flowIntoBlock($block, $newFlowDecay, $falling); } } public function onEntityInside(Entity $entity) : bool{ $ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_LAVA, 4); $entity->attack($ev); //in java burns entities for 15 seconds - seems to be a parity issue in bedrock $ev = new EntityCombustByBlockEvent($this, $entity, 8); $ev->call(); if(!$ev->isCancelled()){ $entity->setOnFire($ev->getDuration()); } $entity->resetFallDistance(); return true; } }