mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Add quitMessage parameter to Player::kick()
This commit is contained in:
parent
bfcef2ab6b
commit
0c350f2f57
@ -3171,11 +3171,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
*
|
*
|
||||||
* @param string $reason
|
* @param string $reason
|
||||||
* @param bool $isAdmin
|
* @param bool $isAdmin
|
||||||
|
* @param TextContainer|string $quitMessage
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function kick(string $reason = "", bool $isAdmin = true) : bool{
|
public function kick(string $reason = "", bool $isAdmin = true, $quitMessage = null) : bool{
|
||||||
$this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, $this->getLeaveMessage()));
|
$this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, $quitMessage ?? $this->getLeaveMessage()));
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$reason = $ev->getReason();
|
$reason = $ev->getReason();
|
||||||
$message = $reason;
|
$message = $reason;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user