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.
This commit is contained in:
Dylan K. Taylor 2020-10-06 18:22:46 +01:00
parent d7f7e1c4ff
commit 531c6344fe

View File

@ -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{