diff options
author | syeyoung <cyoung06@naver.com> | 2023-01-26 00:57:06 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-01-26 00:57:21 +0900 |
commit | 4621a34d61304907b834bc7893cc79488eccb957 (patch) | |
tree | 0686395a4825bb96802c6903101781392f2f08b5 /mod | |
parent | cbba9e138c45a3646640c968b29ce2d14394f678 (diff) | |
download | Skyblock-Dungeons-Guide-4621a34d61304907b834bc7893cc79488eccb957.tar.gz Skyblock-Dungeons-Guide-4621a34d61304907b834bc7893cc79488eccb957.tar.bz2 Skyblock-Dungeons-Guide-4621a34d61304907b834bc7893cc79488eccb957.zip |
- Fix a bug where freezing line didn't work
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod')
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<>(); |