mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix pathfinding to coordinates
- Now possible to walk to given coordinates - Fix sending location before it is received
This commit is contained in:
parent
b0c8f82697
commit
902b04656c
2 changed files with 8 additions and 5 deletions
|
|
@ -32,6 +32,7 @@ namespace MinecraftClient
|
|||
public void BotClear() { bots.Clear(); }
|
||||
|
||||
private object locationLock = new object();
|
||||
private bool locationReceived = false;
|
||||
private World world = new World();
|
||||
private Queue<Location> steps;
|
||||
private Queue<Location> path;
|
||||
|
|
@ -356,6 +357,7 @@ namespace MinecraftClient
|
|||
this.location += location;
|
||||
}
|
||||
else this.location = location;
|
||||
locationReceived = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -468,7 +470,7 @@ namespace MinecraftClient
|
|||
}
|
||||
}
|
||||
|
||||
if (Settings.TerrainAndMovements)
|
||||
if (Settings.TerrainAndMovements && locationReceived)
|
||||
{
|
||||
lock (locationLock)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue