mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 08:56:15 +00:00
Implemented Channeled packet sending
This commit is contained in:
@ -24,6 +24,7 @@ namespace pocketmine\command\defaults;
|
||||
use pocketmine\command\Command;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\event\TranslationContainer;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\SetDifficultyPacket;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\utils\TextFormat;
|
||||
@ -61,7 +62,7 @@ class DifficultyCommand extends VanillaCommand{
|
||||
|
||||
$pk = new SetDifficultyPacket();
|
||||
$pk->difficulty = $sender->getServer()->getDifficulty();
|
||||
Server::broadcastPacket($sender->getServer()->getOnlinePlayers(), $pk);
|
||||
Server::broadcastPacket($sender->getServer()->getOnlinePlayers(), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.difficulty.success", [$difficulty]));
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user