diff --git a/src/pocketmine/block/Liquid.php b/src/pocketmine/block/Liquid.php index 0c92270c6..343c874e9 100644 --- a/src/pocketmine/block/Liquid.php +++ b/src/pocketmine/block/Liquid.php @@ -241,9 +241,9 @@ abstract class Liquid extends Transparent{ if($k !== $decay){ $decay = $k; if($decay < 0){ - $this->getLevel()->setBlock($this, new Air(), true); + $this->getLevel()->setBlock($this, new Air(), true, true); }else{ - $this->getLevel()->setBlock($this, Block::get($this->id, $decay), true); + $this->getLevel()->setBlock($this, Block::get($this->id, $decay), true, true); $this->getLevel()->scheduleDelayedBlockUpdate($this, $this->tickRate()); } }elseif($flag){ @@ -256,19 +256,13 @@ abstract class Liquid extends Transparent{ $bottomBlock = $this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z)); - if($bottomBlock->canBeFlowedInto() or $bottomBlock instanceof Liquid){ - if($this instanceof Lava and $bottomBlock instanceof Water){ - $this->getLevel()->setBlock($bottomBlock, Block::get(Item::STONE), true); - return; - } + if($this instanceof Lava and $bottomBlock instanceof Water){ + $this->getLevel()->setBlock($bottomBlock, Block::get(Block::STONE), true, true); + + }elseif($bottomBlock->canBeFlowedInto() or ($bottomBlock instanceof Liquid and ($bottomBlock->getDamage() & 0x07) !== 0)){ + $this->getLevel()->setBlock($bottomBlock, Block::get($this->id, $decay | 0x08), true, false); + $this->getLevel()->scheduleDelayedBlockUpdate($bottomBlock, $this->tickRate()); - if($decay >= 8){ - $this->getLevel()->setBlock($bottomBlock, Block::get($this->id, $decay), true); - $this->getLevel()->scheduleDelayedBlockUpdate($bottomBlock, $this->tickRate()); - }else{ - $this->getLevel()->setBlock($bottomBlock, Block::get($this->id, $decay + 8), true); - $this->getLevel()->scheduleDelayedBlockUpdate($bottomBlock, $this->tickRate()); - } }elseif($decay >= 0 and ($decay === 0 or !$bottomBlock->canBeFlowedInto())){ $flags = $this->getOptimalFlowDirections(); @@ -311,7 +305,7 @@ abstract class Liquid extends Transparent{ $this->getLevel()->useBreakOn($block); } - $this->getLevel()->setBlock($block, Block::get($this->getId(), $newFlowDecay), true); + $this->getLevel()->setBlock($block, Block::get($this->getId(), $newFlowDecay), true, false); $this->getLevel()->scheduleDelayedBlockUpdate($block, $this->tickRate()); } } @@ -440,9 +434,9 @@ abstract class Liquid extends Transparent{ if($colliding){ if($this->getDamage() === 0){ - $this->getLevel()->setBlock($this, Block::get(Item::OBSIDIAN), true); + $this->getLevel()->setBlock($this, Block::get(Item::OBSIDIAN), true, true); }elseif($this->getDamage() <= 4){ - $this->getLevel()->setBlock($this, Block::get(Item::COBBLESTONE), true); + $this->getLevel()->setBlock($this, Block::get(Item::COBBLESTONE), true, true); } } } diff --git a/src/pocketmine/block/StillLava.php b/src/pocketmine/block/StillLava.php index c867fe787..878af6941 100644 --- a/src/pocketmine/block/StillLava.php +++ b/src/pocketmine/block/StillLava.php @@ -29,13 +29,6 @@ class StillLava extends Lava{ protected $id = self::STILL_LAVA; - public function onUpdate($type){ - if($type !== Level::BLOCK_UPDATE_SCHEDULED){ - return parent::onUpdate($type); - } - return false; - } - public function getName(){ return "Still Lava"; } diff --git a/src/pocketmine/block/StillWater.php b/src/pocketmine/block/StillWater.php index b743f1a3e..0e4cbe685 100644 --- a/src/pocketmine/block/StillWater.php +++ b/src/pocketmine/block/StillWater.php @@ -29,14 +29,6 @@ class StillWater extends Water{ protected $id = self::STILL_WATER; - public function onUpdate($type){ - //TODO: add freezing in cold biomes - if($type !== Level::BLOCK_UPDATE_SCHEDULED){ - return parent::onUpdate($type); - } - return false; - } - public function getName(){ return "Still Water"; }