mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
Fixed liquid flow attempting to set negative block damage values
This should only execute if the current liquid block is actually still existent. When decay is negative, it means the water block doesn't exist anymore.
This commit is contained in:
parent
c3cf82ab26
commit
ea5bd0348a
@ -254,6 +254,7 @@ abstract class Liquid extends Transparent{
|
|||||||
//$this->updateFlow();
|
//$this->updateFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($decay >= 0){
|
||||||
$bottomBlock = $this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z));
|
$bottomBlock = $this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z));
|
||||||
|
|
||||||
if($this instanceof Lava and $bottomBlock instanceof Water){
|
if($this instanceof Lava and $bottomBlock instanceof Water){
|
||||||
@ -263,7 +264,7 @@ abstract class Liquid extends Transparent{
|
|||||||
$this->getLevel()->setBlock($bottomBlock, BlockFactory::get($this->id, $decay | 0x08), true, false);
|
$this->getLevel()->setBlock($bottomBlock, BlockFactory::get($this->id, $decay | 0x08), true, false);
|
||||||
$this->getLevel()->scheduleDelayedBlockUpdate($bottomBlock, $this->tickRate());
|
$this->getLevel()->scheduleDelayedBlockUpdate($bottomBlock, $this->tickRate());
|
||||||
|
|
||||||
}elseif($decay >= 0 and ($decay === 0 or !$bottomBlock->canBeFlowedInto())){
|
}elseif($decay === 0 or !$bottomBlock->canBeFlowedInto()){
|
||||||
$flags = $this->getOptimalFlowDirections();
|
$flags = $this->getOptimalFlowDirections();
|
||||||
|
|
||||||
$l = $decay + $multiplier;
|
$l = $decay + $multiplier;
|
||||||
@ -274,6 +275,7 @@ abstract class Liquid extends Transparent{
|
|||||||
|
|
||||||
if($l >= 8){
|
if($l >= 8){
|
||||||
$this->checkForHarden();
|
$this->checkForHarden();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +297,7 @@ abstract class Liquid extends Transparent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->checkForHarden();
|
$this->checkForHarden();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user