Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor
2022-10-31 19:11:39 +00:00
15 changed files with 130 additions and 64 deletions

View File

@ -76,7 +76,7 @@ class HelpCommand extends VanillaCommand{
$commands = [];
foreach($sender->getServer()->getCommandMap()->getCommands() as $command){
if($command->testPermissionSilent($sender)){
$commands[$command->getName()] = $command;
$commands[$command->getLabel()] = $command;
}
}
ksort($commands, SORT_NATURAL | SORT_FLAG_CASE);
@ -91,7 +91,7 @@ class HelpCommand extends VanillaCommand{
foreach($commands[$pageNumber - 1] as $command){
$description = $command->getDescription();
$descriptionString = $description instanceof Translatable ? $lang->translate($description) : $description;
$sender->sendMessage(TextFormat::DARK_GREEN . "/" . $command->getName() . ": " . TextFormat::RESET . $descriptionString);
$sender->sendMessage(TextFormat::DARK_GREEN . "/" . $command->getLabel() . ": " . TextFormat::RESET . $descriptionString);
}
}
@ -102,7 +102,7 @@ class HelpCommand extends VanillaCommand{
$lang = $sender->getLanguage();
$description = $cmd->getDescription();
$descriptionString = $description instanceof Translatable ? $lang->translate($description) : $description;
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_help_specificCommand_header($cmd->getName())
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_help_specificCommand_header($cmd->getLabel())
->format(TextFormat::YELLOW . "--------- " . TextFormat::RESET, TextFormat::YELLOW . " ---------"));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_help_specificCommand_description(TextFormat::RESET . $descriptionString)
->prefix(TextFormat::GOLD));

View File

@ -78,10 +78,10 @@ class StatusCommand extends VanillaCommand{
$sender->sendMessage(TextFormat::GOLD . "Uptime: " . TextFormat::RED . $uptime);
$tpsColor = TextFormat::GREEN;
if($server->getTicksPerSecond() < 17){
$tpsColor = TextFormat::GOLD;
}elseif($server->getTicksPerSecond() < 12){
if($server->getTicksPerSecond() < 12){
$tpsColor = TextFormat::RED;
}elseif($server->getTicksPerSecond() < 17){
$tpsColor = TextFormat::GOLD;
}
$sender->sendMessage(TextFormat::GOLD . "Current TPS: {$tpsColor}{$server->getTicksPerSecond()} ({$server->getTickUsage()}%)");