diff --git a/src/block/Lava.php b/src/block/Lava.php index e897a606b..aa1dec075 100644 --- a/src/block/Lava.php +++ b/src/block/Lava.php @@ -54,7 +54,7 @@ class Lava extends Liquid{ return 2; //TODO: this is 1 in the nether } - protected function checkForHarden() : void{ + protected function checkForHarden() : bool{ $colliding = null; foreach(Facing::ALL as $side){ if($side === Facing::DOWN){ @@ -70,10 +70,13 @@ class Lava extends Liquid{ if($colliding !== null){ if($this->decay === 0){ $this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN()); + return true; }elseif($this->decay <= 4){ $this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE()); + return true; } } + return false; } protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{ diff --git a/src/block/Liquid.php b/src/block/Liquid.php index 68990cb14..3cf491640 100644 --- a/src/block/Liquid.php +++ b/src/block/Liquid.php @@ -251,8 +251,9 @@ abstract class Liquid extends Transparent{ } public function onNearbyBlockChange() : void{ - $this->checkForHarden(); - $this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, $this->tickRate()); + if(!$this->checkForHarden()){ + $this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, $this->tickRate()); + } } public function onScheduledUpdate() : void{ @@ -469,8 +470,8 @@ abstract class Liquid extends Transparent{ return ($decay >= 0 && $blockDecay >= $decay) ? $decay : $blockDecay; } - protected function checkForHarden() : void{ - + protected function checkForHarden() : bool{ + return false; } protected function liquidCollide(Block $cause, Block $result) : bool{