mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Use Event::hasHandlers() for a few more hot events
This commit is contained in:
@ -972,14 +972,17 @@ class World implements ChunkManager{
|
||||
$block = $replacement;
|
||||
}
|
||||
|
||||
$ev = new BlockUpdateEvent($block);
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
foreach($this->getNearbyEntities(AxisAlignedBB::one()->offset($x, $y, $z)) as $entity){
|
||||
$entity->onNearbyBlockChange();
|
||||
if(BlockUpdateEvent::hasHandlers()){
|
||||
$ev = new BlockUpdateEvent($block);
|
||||
$ev->call();
|
||||
if($ev->isCancelled()){
|
||||
continue;
|
||||
}
|
||||
$block->onNearbyBlockChange();
|
||||
}
|
||||
foreach($this->getNearbyEntities(AxisAlignedBB::one()->offset($x, $y, $z)) as $entity){
|
||||
$entity->onNearbyBlockChange();
|
||||
}
|
||||
$block->onNearbyBlockChange();
|
||||
}
|
||||
|
||||
$this->timings->scheduledBlockUpdates->stopTiming();
|
||||
|
Reference in New Issue
Block a user