From 531c6344fe6bd920ef2b6639b7ff649cfe8bf11c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 6 Oct 2020 18:22:46 +0100 Subject: [PATCH] Entity: stop using broadcastPacketToViewers for movement / motion this is now effectively identical to sending packets to each of hasSpawned, with the exception that it won't send packets to itself if it's a player. --- src/entity/Entity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index d746c0a2f..426503785 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -753,11 +753,11 @@ abstract class Entity{ $pk->flags |= MoveActorAbsolutePacket::FLAG_GROUND; } - $this->getWorld()->broadcastPacketToViewers($this->location, $pk); + $this->server->broadcastPackets($this->hasSpawned, [$pk]); } protected function broadcastMotion() : void{ - $this->getWorld()->broadcastPacketToViewers($this->location, SetActorMotionPacket::create($this->id, $this->getMotion())); + $this->server->broadcastPackets($this->hasSpawned, [SetActorMotionPacket::create($this->id, $this->getMotion())]); } public function hasGravity() : bool{