mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
SimpleCommandMap: clean up error reporting in registerServerAliases()
This commit is contained in:
parent
9d80802e53
commit
c123f2d10b
@ -302,9 +302,9 @@ class SimpleCommandMap implements CommandMap{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$targets = [];
|
$targets = [];
|
||||||
|
$bad = [];
|
||||||
|
$recursive = [];
|
||||||
|
|
||||||
$bad = "";
|
|
||||||
$recursive = "";
|
|
||||||
foreach($commandStrings as $commandString){
|
foreach($commandStrings as $commandString){
|
||||||
$args = explode(" ", $commandString);
|
$args = explode(" ", $commandString);
|
||||||
$commandName = "";
|
$commandName = "";
|
||||||
@ -312,27 +312,21 @@ class SimpleCommandMap implements CommandMap{
|
|||||||
|
|
||||||
|
|
||||||
if($command === null){
|
if($command === null){
|
||||||
if(strlen($bad) > 0){
|
$bad[] = $commandString;
|
||||||
$bad .= ", ";
|
|
||||||
}
|
|
||||||
$bad .= $commandString;
|
|
||||||
}elseif($commandName === $alias){
|
}elseif($commandName === $alias){
|
||||||
if($recursive !== ""){
|
$recursive[] = $commandString;
|
||||||
$recursive .= ", ";
|
|
||||||
}
|
|
||||||
$recursive .= $commandString;
|
|
||||||
}else{
|
}else{
|
||||||
$targets[] = $commandString;
|
$targets[] = $commandString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($recursive !== ""){
|
if(!empty($recursive)){
|
||||||
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.recursive", [$alias, $recursive]));
|
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.recursive", [$alias, implode(", ", $recursive)]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($bad) > 0){
|
if(!empty($bad)){
|
||||||
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.notFound", [$alias, $bad]));
|
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.notFound", [$alias, implode(", ", $bad)]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user