diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 74899a015..58f6da2b7 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -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