mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Added Server->broadcastTip() and Server->broadcastPopup()
Signed-off-by: Michael Yoo <michael@yoo.id.au>
This commit is contained in:
parent
388f5c2c91
commit
adc5aa11ac
@ -1764,8 +1764,8 @@ class Server{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $message
|
||||
* @param Player[] $recipients
|
||||
* @param $message
|
||||
* @param Player[]|null $recipients
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@ -1780,6 +1780,40 @@ class Server{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $tip
|
||||
* @param Player[]|null $recipients
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function broadcastTip($tip, $recipients = null){
|
||||
if(!is_array($recipients)){
|
||||
return $this->broadcastTip($tip, $this->getOnlinePlayers());
|
||||
}
|
||||
|
||||
/** @var Player[] $recipients */
|
||||
foreach($recipients as $recipient){
|
||||
$recipient->sendTip($tip);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $popup
|
||||
* @param Player[]|null $recipients
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function broadcastPopup($popup, $recipients = null){
|
||||
if(!is_array($recipients)){
|
||||
return $this->broadcastPopup($popup, $this->getOnlinePlayers());
|
||||
}
|
||||
|
||||
/** @var Player[] $recipients */
|
||||
foreach($recipients as $recipient){
|
||||
$recipient->sendPopup($popup);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $permissions
|
||||
|
Loading…
x
Reference in New Issue
Block a user