mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +00:00
BlockUpdateEvent doesn't allow changing the target block anyway
This commit is contained in:
parent
fd8a562e02
commit
41f292d995
@ -711,11 +711,11 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
Level::getBlockXYZ($index, $x, $y, $z);
|
Level::getBlockXYZ($index, $x, $y, $z);
|
||||||
|
|
||||||
$block = $this->getBlock($this->temporalVector->setComponents($x, $y, $z));
|
$block = $this->getBlock($this->temporalVector->setComponents($x, $y, $z));
|
||||||
$block->clearBoundingBoxes(); //this MUST apply to the original block, not the block chosen by a plugin
|
$block->clearBoundingBoxes(); //for blocks like fences, force recalculation of connected AABBs
|
||||||
|
|
||||||
$this->server->getPluginManager()->callEvent($ev = new BlockUpdateEvent($block));
|
$this->server->getPluginManager()->callEvent($ev = new BlockUpdateEvent($block));
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$ev->getBlock()->onUpdate(self::BLOCK_UPDATE_NORMAL);
|
$block->onUpdate(self::BLOCK_UPDATE_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user