mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
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:
parent
d7f7e1c4ff
commit
531c6344fe
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user