mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Liquid: do not schedule delayed blockupdate when hardening occurs on nearby blockupdate
fix #3390 fix #3392
This commit is contained in:
parent
b74f177958
commit
6f38031121
@ -54,7 +54,7 @@ class Lava extends Liquid{
|
|||||||
return 2; //TODO: this is 1 in the nether
|
return 2; //TODO: this is 1 in the nether
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkForHarden() : void{
|
protected function checkForHarden() : bool{
|
||||||
$colliding = null;
|
$colliding = null;
|
||||||
foreach(Facing::ALL as $side){
|
foreach(Facing::ALL as $side){
|
||||||
if($side === Facing::DOWN){
|
if($side === Facing::DOWN){
|
||||||
@ -70,10 +70,13 @@ class Lava extends Liquid{
|
|||||||
if($colliding !== null){
|
if($colliding !== null){
|
||||||
if($this->decay === 0){
|
if($this->decay === 0){
|
||||||
$this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN());
|
$this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN());
|
||||||
|
return true;
|
||||||
}elseif($this->decay <= 4){
|
}elseif($this->decay <= 4){
|
||||||
$this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE());
|
$this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{
|
protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{
|
||||||
|
@ -251,9 +251,10 @@ abstract class Liquid extends Transparent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
$this->checkForHarden();
|
if(!$this->checkForHarden()){
|
||||||
$this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, $this->tickRate());
|
$this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, $this->tickRate());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function onScheduledUpdate() : void{
|
public function onScheduledUpdate() : void{
|
||||||
$multiplier = $this->getFlowDecayPerBlock();
|
$multiplier = $this->getFlowDecayPerBlock();
|
||||||
@ -469,8 +470,8 @@ abstract class Liquid extends Transparent{
|
|||||||
return ($decay >= 0 && $blockDecay >= $decay) ? $decay : $blockDecay;
|
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{
|
protected function liquidCollide(Block $cause, Block $result) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user