Minecraft-Console-Client/MinecraftClient/Commands/Tps.cs
BruceChen 077e3a5e9f
Crowdin localization support (#2310)
* Switching to use resource files

* Update Crowdin configuration file

* Code cleanup
2022-10-28 11:13:20 +08:00

25 lines
825 B
C#

using System;
using System.Collections.Generic;
namespace MinecraftClient.Commands
{
class Tps : Command
{
public override string CmdName { get { return "tps"; } }
public override string CmdUsage { get { return "tps"; } }
public override string CmdDesc { get { return Translations.cmd_tps_desc; } }
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
{
var tps = Math.Round(handler.GetServerTPS(), 2);
string color;
if (tps < 10)
color = "§c"; // Red
else if (tps < 15)
color = "§e"; // Yellow
else
color = "§a"; // Green
return Translations.cmd_tps_current + ": " + color + tps;
}
}
}