mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-21 15:41:46 +01:00
Fix typo
This commit is contained in:
parent
6d1aad513e
commit
f86b387c82
@ -82,7 +82,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
|||||||
CancelReason reason = planner.tick(Setting.ASTAR_ITERATIONS_PER_TICK.asInt(),
|
CancelReason reason = planner.tick(Setting.ASTAR_ITERATIONS_PER_TICK.asInt(),
|
||||||
Setting.MAXIMUM_ASTAR_ITERATIONS.asInt());
|
Setting.MAXIMUM_ASTAR_ITERATIONS.asInt());
|
||||||
plan = planner.plan;
|
plan = planner.plan;
|
||||||
if (reason == null || plan == null)
|
if (reason == null && plan == null)
|
||||||
return false;
|
return false;
|
||||||
setCancelReason(reason);
|
setCancelReason(reason);
|
||||||
planner = null;
|
planner = null;
|
||||||
@ -93,18 +93,18 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
|||||||
vector = plan.getCurrentVector();
|
vector = plan.getCurrentVector();
|
||||||
}
|
}
|
||||||
Location loc = npc.getEntity().getLocation();
|
Location loc = npc.getEntity().getLocation();
|
||||||
|
Location dest = Util.getCenterLocation(vector.toLocation(loc.getWorld()).getBlock());
|
||||||
/* Proper door movement - gets stuck on corners at times
|
/* Proper door movement - gets stuck on corners at times
|
||||||
|
|
||||||
Block block = currLoc.getWorld().getBlockAt(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
|
Block block = loc.getWorld().getBlockAt(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
|
||||||
if (MinecraftBlockExaminer.isDoor(block.getType())) {
|
if (MinecraftBlockExaminer.isDoor(block.getType())) {
|
||||||
Door door = (Door) block.getState().getData();
|
Door door = (Door) block.getState().getData();
|
||||||
if (door.isOpen()) {
|
if (door.isOpen()) {
|
||||||
BlockFace targetFace = door.getFacing().getOppositeFace();
|
BlockFace targetFace = door.getFacing().getOppositeFace();
|
||||||
destVector.setX(vector.getX() + targetFace.getModX());
|
dest.setX(vector.getX() + targetFace.getModX());
|
||||||
destVector.setZ(vector.getZ() + targetFace.getModZ());
|
dest.setZ(vector.getZ() + targetFace.getModZ());
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
Location dest = Util.getCenterLocation(vector.toLocation(loc.getWorld()).getBlock());
|
|
||||||
double dX = dest.getX() - loc.getX();
|
double dX = dest.getX() - loc.getX();
|
||||||
double dZ = dest.getZ() - loc.getZ();
|
double dZ = dest.getZ() - loc.getZ();
|
||||||
double dY = dest.getY() - loc.getY();
|
double dY = dest.getY() - loc.getY();
|
||||||
|
Loading…
Reference in New Issue
Block a user