diff options
Diffstat (limited to 'mod/src')
3 files changed, 6 insertions, 3 deletions
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 426c75ae..4b142e17 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,24 +90,25 @@ public class ActionMove extends AbstractAction { private int tick = -1; private List<Vec3> poses; private PathfinderExecutor executor; - @Override public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); if (executor == null) { executor = dungeonRoom.createEntityPathTo(target.getBlockPos(dungeonRoom)); + executor.setTarget(Minecraft.getMinecraft().thePlayer.getPositionVector()); } if (executor != null) { poses = executor.getRoute(Minecraft.getMinecraft().thePlayer.getPositionVector()); } if (tick == 0 && actionRouteProperties.isPathfind() && executor != null) { - if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null || actionRouteProperties.getLineRefreshRate() != -1) { + if (actionRouteProperties.getLineRefreshRate() != -1 && !FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() && executor.isComplete()) { executor.setTarget(Minecraft.getMinecraft().thePlayer.getPositionVector()); } } } + public void forceRefresh(DungeonRoom dungeonRoom) { if (executor != null) 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 c12d1ffd..27a356c6 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 @@ -65,13 +65,14 @@ public class ActionMoveNearestAir extends AbstractAction { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); if (executor == null) { executor = dungeonRoom.createEntityPathTo(target.getBlockPos(dungeonRoom)); + executor.setTarget(Minecraft.getMinecraft().thePlayer.getPositionVector()); } if (executor != null) { poses = executor.getRoute(Minecraft.getMinecraft().thePlayer.getPositionVector()); } if (tick == 0 && actionRouteProperties.isPathfind() && executor != null) { - if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null || actionRouteProperties.getLineRefreshRate() != -1) { + if (actionRouteProperties.getLineRefreshRate() != -1 && !FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() && executor.isComplete()) { 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 0313d3c4..76c69cc5 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 @@ -34,6 +34,7 @@ public class PathfinderExecutor { private DungeonRoom dungeonRoom; private IPathfinder pathfinder; + @Getter private boolean isComplete = false; private List<Vec3> lastRoute = new ArrayList<>(); |