mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed BlockDeathEvent usages showing an oldState which is already dead
This commit is contained in:
parent
e9e5923639
commit
bb0e648276
@ -51,7 +51,7 @@ abstract class BaseCoral extends Transparent{
|
|||||||
|
|
||||||
//TODO: check water inside the block itself (not supported on the API yet)
|
//TODO: check water inside the block itself (not supported on the API yet)
|
||||||
if(!$hasWater){
|
if(!$hasWater){
|
||||||
$ev = new BlockDeathEvent($this, $this->setDead(true));
|
$ev = new BlockDeathEvent($this, (clone $this)->setDead(true));
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$world->setBlock($this->position, $ev->getNewState());
|
$world->setBlock($this->position, $ev->getNewState());
|
||||||
|
@ -78,7 +78,7 @@ final class CoralBlock extends Opaque{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$hasWater){
|
if(!$hasWater){
|
||||||
$ev = new BlockDeathEvent($this, $this->setDead(true));
|
$ev = new BlockDeathEvent($this, (clone $this)->setDead(true));
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$world->setBlock($this->position, $ev->getNewState());
|
$world->setBlock($this->position, $ev->getNewState());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user