mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +00:00
oops, a merge error
This commit is contained in:
parent
8fc11c6ce0
commit
bfe766e626
@ -326,17 +326,18 @@ abstract class Liquid extends Transparent{
|
|||||||
|
|
||||||
protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{
|
protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{
|
||||||
if($this->canFlowInto($block) and !($block instanceof Liquid)){
|
if($this->canFlowInto($block) and !($block instanceof Liquid)){
|
||||||
$ev = new BlockSpreadEvent($block, $this, BlockFactory::get($this->getId(), $newFlowDecay));
|
$new = clone $this;
|
||||||
|
$new->falling = $falling;
|
||||||
|
$new->decay = $falling ? 0 : $newFlowDecay;
|
||||||
|
|
||||||
|
$ev = new BlockSpreadEvent($block, $this, $new);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
if($block->getId() > 0){
|
if($block->getId() > 0){
|
||||||
$this->level->useBreakOn($block);
|
$this->level->useBreakOn($block);
|
||||||
}
|
}
|
||||||
|
|
||||||
$new = clone $this;
|
$this->level->setBlock($block, $ev->getNewState());
|
||||||
$new->falling = $falling;
|
|
||||||
$new->decay = $falling ? 0 : $newFlowDecay;
|
|
||||||
$this->level->setBlock($block, $new);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user