mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 01:16:15 +00:00
Level: Added API method broadcastPacketToViewers()
This supersedes addChunkPacket() in most cases, and has a more clear name. It broadcasts the given packet to every player who has the target position within their chunk load radius.
This commit is contained in:
@ -67,8 +67,7 @@ abstract class Spawnable extends Tile{
|
||||
return;
|
||||
}
|
||||
|
||||
$pk = $this->createSpawnPacket();
|
||||
$this->level->addChunkPacket($this->getFloorX() >> 4, $this->getFloorZ() >> 4, $pk);
|
||||
$this->level->broadcastPacketToViewers($this, $this->createSpawnPacket());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user