Remove colors from VersionCommand

these will have to stay gone for now, until we have some way to terminate formatting codes without breaking logger output. (we need &p!! #4364)
This commit is contained in:
Dylan K. Taylor
2021-08-12 20:35:25 +01:00
parent d18b5cb306
commit fd41a0f510
3 changed files with 10 additions and 21 deletions

View File

@@ -60,22 +60,18 @@ class VersionCommand extends VanillaCommand{
if(count($args) === 0){
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_serverSoftwareName(
TextFormat::GREEN,
VersionInfo::NAME
));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_serverSoftwareVersion(
TextFormat::GREEN,
VersionInfo::getVersionObj()->getFullVersion(),
VersionInfo::getGitHash()
));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_minecraftVersion(
TextFormat::GREEN,
ProtocolInfo::MINECRAFT_VERSION_NETWORK,
(string) ProtocolInfo::CURRENT_PROTOCOL
));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_phpVersion(TextFormat::GREEN, PHP_VERSION));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_phpVersion(PHP_VERSION));
$jitColor = TextFormat::GREEN;
if(
function_exists('opcache_get_status') &&
($opcacheStatus = opcache_get_status(false)) !== false &&
@@ -86,15 +82,14 @@ class VersionCommand extends VanillaCommand{
$jitStatus = KnownTranslationFactory::pocketmine_command_version_phpJitEnabled(
sprintf("CRTO: %s%s%s%s", $jit["opt_flags"] >> 2, $jit["opt_flags"] & 0x03, $jit["kind"], $jit["opt_level"])
);
$jitColor = TextFormat::YELLOW;
}else{
$jitStatus = KnownTranslationFactory::pocketmine_command_version_phpJitDisabled();
}
}else{
$jitStatus = KnownTranslationFactory::pocketmine_command_version_phpJitNotSupported();
}
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_phpJitStatus($jitColor, $sender->getLanguage()->translate($jitStatus)));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_operatingSystem(TextFormat::GREEN, Utils::getOS()));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_phpJitStatus($sender->getLanguage()->translate($jitStatus)));
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_version_operatingSystem(Utils::getOS()));
}else{
$pluginName = implode(" ", $args);
$exactPlugin = $sender->getServer()->getPluginManager()->getPlugin($pluginName);