mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Fixed kick messages
This commit is contained in:
parent
873e35f416
commit
9877271d70
@ -1970,8 +1970,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
public function kick($reason = ""){
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, "Kicked player " . $this->username . "." . ($reason !== "" ? " With reason: $reason" : "")));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->sendMessage("You have been kicked. " . ($reason !== "" ? " Reason: $reason" : "") . "\n");
|
||||
$this->close($ev->getQuitMessage(), $reason);
|
||||
$message = TextFormat::BOLD . "You have been kicked." . ($reason !== "" ? TextFormat::RESET."\nReason: $reason" : "");
|
||||
$this->sendMessage($message);
|
||||
$this->close($ev->getQuitMessage(), $message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class KickCommand extends VanillaCommand{
|
||||
$sender->sendMessage($name . " not found.");
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Kicked player " . $name . ". With reason:\n" . $reason);
|
||||
Command::broadcastCommandMessage($sender, "Kicked player " . $name . ". With reason: " . $reason);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -39,16 +39,6 @@ abstract class AsyncTask extends \Threaded{
|
||||
$this->result = null;
|
||||
$this->onRun();
|
||||
$this->finished = true;
|
||||
$this->complete = $this->result === null ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isCompleted(){
|
||||
return $this->synchronized(function(){
|
||||
return $this->complete === true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,7 +215,7 @@ class ServerScheduler{
|
||||
|
||||
if($this->asyncTasks > 0){ //Garbage collector
|
||||
$this->asyncPool->collect(function (AsyncTask $task){
|
||||
if($task->isCompleted() or ($task->isFinished() and !$task->hasResult())){
|
||||
if($task->isFinished()){
|
||||
--$this->asyncTasks;
|
||||
$task->onCompletion(Server::getInstance());
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user