mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 05:55:33 +00:00
Fixed doc type inconsistencies surrounding chat broadcast handling (several problems that are all related)
This commit is contained in:
parent
dbab8b5733
commit
c4a8781b5c
@ -1789,7 +1789,7 @@ class Server{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param TextContainer|string $message
|
* @param TextContainer|string $message
|
||||||
* @param Player[] $recipients
|
* @param CommandSender[] $recipients
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
@ -1798,7 +1798,7 @@ class Server{
|
|||||||
return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS);
|
return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Player[] $recipients */
|
/** @var CommandSender[] $recipients */
|
||||||
foreach($recipients as $recipient){
|
foreach($recipients as $recipient){
|
||||||
$recipient->sendMessage($message);
|
$recipient->sendMessage($message);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\event\player;
|
namespace pocketmine\event\player;
|
||||||
|
|
||||||
|
use pocketmine\command\CommandSender;
|
||||||
use pocketmine\event\Cancellable;
|
use pocketmine\event\Cancellable;
|
||||||
use pocketmine\permission\PermissionManager;
|
use pocketmine\permission\PermissionManager;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
@ -39,15 +40,15 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
|||||||
protected $format;
|
protected $format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Player[]
|
* @var CommandSender[]
|
||||||
*/
|
*/
|
||||||
protected $recipients = [];
|
protected $recipients = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Player $player
|
* @param Player $player
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param string $format
|
* @param string $format
|
||||||
* @param Player[] $recipients
|
* @param CommandSender[] $recipients
|
||||||
*/
|
*/
|
||||||
public function __construct(Player $player, string $message, string $format = "chat.type.text", array $recipients = null){
|
public function __construct(Player $player, string $message, string $format = "chat.type.text", array $recipients = null){
|
||||||
$this->player = $player;
|
$this->player = $player;
|
||||||
@ -100,14 +101,14 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Player[]
|
* @return CommandSender[]
|
||||||
*/
|
*/
|
||||||
public function getRecipients() : array{
|
public function getRecipients() : array{
|
||||||
return $this->recipients;
|
return $this->recipients;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Player[] $recipients
|
* @param CommandSender[] $recipients
|
||||||
*/
|
*/
|
||||||
public function setRecipients(array $recipients) : void{
|
public function setRecipients(array $recipients) : void{
|
||||||
$this->recipients = $recipients;
|
$this->recipients = $recipients;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user