Upgrade GetLookingBlock

This commit is contained in:
BruceChen 2022-10-02 13:49:36 +08:00 committed by GitHub
parent ba6a954f45
commit 4aa6c1c99f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 213 additions and 74 deletions

View file

@ -203,7 +203,7 @@ namespace MinecraftClient.ChatBots
public override void OnEntityDespawn(Entity entity)
{
if (entity.Type == EntityType.FishingBobber && entity.ID == fishingBobber!.ID)
if (entity != null && entity.Type == EntityType.FishingBobber && entity.ID == fishingBobber!.ID)
{
if (Settings.AutoFishing_LogFishingBobber)
LogToConsole(string.Format("FishingBobber despawn at {0}", entity.Location));
@ -228,7 +228,7 @@ namespace MinecraftClient.ChatBots
public override void OnEntityMove(Entity entity)
{
if (isFishing && fishingBobber!.ID == entity.ID)
if (isFishing && entity != null && fishingBobber!.ID == entity.ID)
{
Location Pos = entity.Location;
double Dx = LastPos.X - Pos.X;