From 85fa716c4f000f2e0b50c6c5f4449d4033b87f97 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sat, 11 Feb 2023 19:45:52 +0900 Subject: - Fix refresh line not working as intended Signed-off-by: syeyoung --- .../java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java | 2 +- .../dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java | 2 +- .../mod/dungeon/pathfinding/algorithms/PathfinderExecutor.java | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'mod/src/main') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java index 56dd9ada..8f1fc2d1 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java @@ -90,7 +90,7 @@ public class ActionMove extends AbstractAction { @Override public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); - if (executor == null) { + if (executor == null && actionRouteProperties.isPathfind()) { executor = dungeonRoom.createEntityPathTo(target.getBlockPos(dungeonRoom)); executor.setTarget(Minecraft.getMinecraft().thePlayer.getPositionVector()); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java index 27a356c6..dce9494a 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java @@ -63,7 +63,7 @@ public class ActionMoveNearestAir extends AbstractAction { @Override public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); - if (executor == null) { + if (executor == null && actionRouteProperties.isPathfind()) { executor = dungeonRoom.createEntityPathTo(target.getBlockPos(dungeonRoom)); executor.setTarget(Minecraft.getMinecraft().thePlayer.getPositionVector()); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/algorithms/PathfinderExecutor.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/algorithms/PathfinderExecutor.java index 76c69cc5..8dcd499c 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/algorithms/PathfinderExecutor.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/algorithms/PathfinderExecutor.java @@ -42,6 +42,7 @@ public class PathfinderExecutor { this.pathfinder = pathfinder; this.target = target; this.dungeonRoom = dungeonRoom; + pathfinder.init(dungeonRoom, target); } -- cgit