diff --git a/src/world/Explosion.php b/src/world/Explosion.php index 722b08e90..86d9eeb80 100644 --- a/src/world/Explosion.php +++ b/src/world/Explosion.php @@ -28,14 +28,12 @@ use pocketmine\block\BlockFactory; use pocketmine\block\TNT; use pocketmine\block\VanillaBlocks; use pocketmine\entity\Entity; -use pocketmine\event\block\BlockUpdateEvent; use pocketmine\event\entity\EntityDamageByBlockEvent; use pocketmine\event\entity\EntityDamageByEntityEvent; use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\entity\EntityExplodeEvent; use pocketmine\item\ItemFactory; use pocketmine\math\AxisAlignedBB; -use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\world\format\SubChunk; use pocketmine\world\particle\HugeExplodeSeedParticle; @@ -227,29 +225,7 @@ class Explosion{ if(($t = $this->world->getTileAt($pos->x, $pos->y, $pos->z)) !== null){ $t->onBlockDestroyed(); //needed to create drops for inventories } - $this->world->setBlockAt($pos->x, $pos->y, $pos->z, $airBlock, false); //TODO: should updating really be disabled here? - $this->world->updateAllLight($pos->x, $pos->y, $pos->z); - } - } - - foreach($this->affectedBlocks as $block){ - $pos = $block->getPosition(); - foreach(Facing::ALL as $side){ - $sideBlock = $pos->getSide($side); - if(!$this->world->isInWorld($sideBlock->x, $sideBlock->y, $sideBlock->z)){ - continue; - } - if(!isset($this->affectedBlocks[$index = World::blockHash($sideBlock->x, $sideBlock->y, $sideBlock->z)]) and !isset($updateBlocks[$index])){ - $ev = new BlockUpdateEvent($this->world->getBlockAt($sideBlock->x, $sideBlock->y, $sideBlock->z)); - $ev->call(); - if(!$ev->isCancelled()){ - foreach($this->world->getNearbyEntities(AxisAlignedBB::one()->offset($sideBlock->x, $sideBlock->y, $sideBlock->z)->expand(1, 1, 1)) as $entity){ - $entity->onNearbyBlockChange(); - } - $ev->getBlock()->onNearbyBlockChange(); - } - $updateBlocks[$index] = true; - } + $this->world->setBlockAt($pos->x, $pos->y, $pos->z, $airBlock); } }