diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index b171a01fc..c0c32313c 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -113,6 +113,7 @@ use pocketmine\utils\UUID; use pocketmine\world\ChunkListener; use pocketmine\world\ChunkLoader; use pocketmine\world\format\Chunk; +use pocketmine\world\particle\PunchBlockParticle; use pocketmine\world\Position; use pocketmine\world\World; use function abs; @@ -1932,11 +1933,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, public function continueBreakBlock(Vector3 $pos, int $face) : void{ $block = $this->world->getBlock($pos); - $this->world->broadcastLevelEvent( - $pos, - LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, - $block->getRuntimeId() | ($face << 24) - ); + $this->world->addParticle($pos, new PunchBlockParticle($block, $face)); //TODO: destroy-progress level event } diff --git a/src/pocketmine/world/particle/PunchBlockParticle.php b/src/pocketmine/world/particle/PunchBlockParticle.php new file mode 100644 index 000000000..ff461c87e --- /dev/null +++ b/src/pocketmine/world/particle/PunchBlockParticle.php @@ -0,0 +1,48 @@ +block = $block; + $this->face = $face; + } + + public function encode(Vector3 $pos){ + return LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, $this->block->getRuntimeId() | ($this->face << 24), $pos); + } +}