mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +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 Player[] $recipients
|
||||
* @param CommandSender[] $recipients
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@ -1798,7 +1798,7 @@ class Server{
|
||||
return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS);
|
||||
}
|
||||
|
||||
/** @var Player[] $recipients */
|
||||
/** @var CommandSender[] $recipients */
|
||||
foreach($recipients as $recipient){
|
||||
$recipient->sendMessage($message);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\player;
|
||||
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\permission\PermissionManager;
|
||||
use pocketmine\Player;
|
||||
@ -39,15 +40,15 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
protected $format;
|
||||
|
||||
/**
|
||||
* @var Player[]
|
||||
* @var CommandSender[]
|
||||
*/
|
||||
protected $recipients = [];
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
* @param string $message
|
||||
* @param string $format
|
||||
* @param Player[] $recipients
|
||||
* @param Player $player
|
||||
* @param string $message
|
||||
* @param string $format
|
||||
* @param CommandSender[] $recipients
|
||||
*/
|
||||
public function __construct(Player $player, string $message, string $format = "chat.type.text", array $recipients = null){
|
||||
$this->player = $player;
|
||||
@ -100,14 +101,14 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player[]
|
||||
* @return CommandSender[]
|
||||
*/
|
||||
public function getRecipients() : array{
|
||||
return $this->recipients;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Player[] $recipients
|
||||
* @param CommandSender[] $recipients
|
||||
*/
|
||||
public function setRecipients(array $recipients) : void{
|
||||
$this->recipients = $recipients;
|
||||
|
Loading…
x
Reference in New Issue
Block a user