Fix all warnings & Trim (#2226)

* Fix AutoFishing crash
* Fix all warnings
* Remove DotNetZip.
* Fix the usage of HttpClient.
This commit is contained in:
BruceChen 2022-10-02 18:31:08 +08:00 committed by GitHub
parent 4aa6c1c99f
commit 1d52d1eadd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
227 changed files with 2201 additions and 43564 deletions

View file

@ -10,11 +10,11 @@ namespace MinecraftClient.Commands
public override string CmdUsage { get { return "execmulti <command 1> -> <command2> -> <command 3> -> ..."; } }
public override string CmdDesc { get { return "cmd.execmulti.desc"; } }
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
{
if (hasArg(command))
if (HasArg(command))
{
string commandsString = getArg(command);
string commandsString = GetArg(command);
if (commandsString.Contains("execmulti", StringComparison.OrdinalIgnoreCase) || commandsString.Contains("execif", StringComparison.OrdinalIgnoreCase))
return Translations.TryGet("cmd.execmulti.prevent");
@ -25,16 +25,17 @@ namespace MinecraftClient.Commands
foreach (string cmd in commands)
{
string output = "";
string? output = "";
handler.PerformInternalCommand(cmd, ref output);
string log = Translations.TryGet(
"cmd.execmulti.executed", cmd,
string.IsNullOrEmpty(output) ? Translations.TryGet("cmd.execmulti.no_result") : Translations.TryGet("cmd.execmulti.result", output));
if (output.Contains("unknown command", StringComparison.OrdinalIgnoreCase))
if (output != null && output.Contains("unknown command", StringComparison.OrdinalIgnoreCase))
handler.Log.Error(log);
else handler.Log.Info(log);
else
handler.Log.Info(log);
}
return "";