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

@ -8,8 +8,8 @@ namespace MinecraftClient.ChatBots
{
private string? _playerToFollow = null;
private int _updateCounter = 0;
private int _updateLimit;
private int _stopAtDistance;
private readonly int _updateLimit;
private readonly int _stopAtDistance;
private bool _unsafeEnabled = false;
public FollowPlayer(int updateLimit = 15, int stopAtDistance = 3)
@ -112,7 +112,7 @@ namespace MinecraftClient.ChatBots
return;
// Stop at specified distance from plater (prevents pushing player around)
double distance = Distance(entity.Location, GetCurrentLocation());
double distance = entity.Location.Distance(GetCurrentLocation());
if (distance < _stopAtDistance)
return;
@ -154,14 +154,6 @@ namespace MinecraftClient.ChatBots
}
}
private double Distance(Location location1, Location location2)
{
return Math.Sqrt(
((location1.X - location2.X) * (location1.X - location2.X)) +
((location1.Y - location2.Y) * (location1.Y - location2.Y)) +
((location1.Z - location2.Z) * (location1.Z - location2.Z)));
}
private bool CanMoveThere(Location location)
{
ChunkColumn? chunkColumn = GetWorld().GetChunkColumn(location);