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

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using MinecraftClient.Mapping;
namespace MinecraftClient.Commands
@ -13,11 +10,11 @@ namespace MinecraftClient.Commands
public override string CmdUsage { get { return "look <x y z|yaw pitch|up|down|east|west|north|south>"; } }
public override string CmdDesc { get { return "cmd.look.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 (handler.GetTerrainEnabled())
{
string[] args = getArgs(command);
string[] args = GetArgs(command);
if (args.Length == 0)
{
const double maxDistance = 8.0;
@ -33,7 +30,7 @@ namespace MinecraftClient.Commands
}
else if (args.Length == 1)
{
string dirStr = getArg(command).Trim().ToLower();
string dirStr = GetArg(command).Trim().ToLower();
Direction direction;
switch (dirStr)
{
@ -53,8 +50,8 @@ namespace MinecraftClient.Commands
{
try
{
float yaw = Single.Parse(args[0]);
float pitch = Single.Parse(args[1]);
float yaw = float.Parse(args[0]);
float pitch = float.Parse(args[1]);
handler.UpdateLocation(handler.GetCurrentLocation(), yaw, pitch);
return Translations.Get("cmd.look.at", yaw.ToString("0.00"), pitch.ToString("0.00"));