mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Fire: do not overwrite blocks during burning unless they were unchanged by onIncinerate()
onIncinerate() by custom blocks might produce custom results which aren't supposed to be burned away (e.g. wood could turn into charred wood, or something of that nature). closes #4764
This commit is contained in:
parent
58e186440b
commit
5d970cf5bd
@ -180,6 +180,7 @@ class Fire extends Flowable{
|
|||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$block->onIncinerate();
|
$block->onIncinerate();
|
||||||
|
|
||||||
|
if($this->position->getWorld()->getBlock($block->getPosition())->isSameState($block)){
|
||||||
$spreadedFire = false;
|
$spreadedFire = false;
|
||||||
if(mt_rand(0, $this->age + 9) < 5){ //TODO: check rain
|
if(mt_rand(0, $this->age + 9) < 5){ //TODO: check rain
|
||||||
$fire = clone $this;
|
$fire = clone $this;
|
||||||
@ -192,6 +193,7 @@ class Fire extends Flowable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function spreadFire() : void{
|
private function spreadFire() : void{
|
||||||
$world = $this->position->getWorld();
|
$world = $this->position->getWorld();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user