Added Tile::saveNBT(), moved Player::broadcastPacket() to Server

This commit is contained in:
Shoghi Cervantes
2014-05-24 13:21:55 +02:00
parent 1fd7e0431b
commit ef6ca9d2cd
11 changed files with 57 additions and 25 deletions

View File

@ -61,6 +61,7 @@ use pocketmine\nbt\tag\Long;
use pocketmine\nbt\tag\Short;
use pocketmine\nbt\tag\String;
use pocketmine\network\Packet;
use pocketmine\network\protocol\DataPacket;
use pocketmine\network\query\QueryHandler;
use pocketmine\network\query\QueryPacket;
use pocketmine\network\raknet\Info as RakNetInfo;
@ -1382,6 +1383,18 @@ class Server{
return $count;
}
/**
* Broadcasts a Minecraft packet to a list of players
*
* @param Player[] $players
* @param DataPacket $packet
*/
public function broadcastPacket(array $players, DataPacket $packet){
foreach($players as $player){
$player->dataPacket(clone $packet);
}
}
/**
* @param int $type