diff options
author | syeyoung <cyong06@naver.com> | 2021-03-20 11:55:27 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-20 11:55:27 +0900 |
commit | 6e8606b2dd52475021cd226758f855e2a59574df (patch) | |
tree | aabd1f6bf76c808751e6c54dd6e422da43bdaed9 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions | |
parent | c11cd2144699ec909897d1eabe90f65992a5bb14 (diff) | |
download | Skyblock-Dungeons-Guide-6e8606b2dd52475021cd226758f855e2a59574df.tar.gz Skyblock-Dungeons-Guide-6e8606b2dd52475021cd226758f855e2a59574df.tar.bz2 Skyblock-Dungeons-Guide-6e8606b2dd52475021cd226758f855e2a59574df.zip |
ability cooldown
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java | 18 |
2 files changed, 21 insertions, 14 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java index 3013d1de..a9d80266 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java @@ -50,24 +50,27 @@ public class ActionMove extends AbstractAction { if (FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() && Keybinds.togglePathfindStatus) return; - if (latest != null){ - List<BlockPos> poses = new ArrayList<BlockPos>(); - for (int i = 0; i < latest.getCurrentPathLength(); i++) { - PathPoint pathPoint = latest.getPathPointFromIndex(i); - poses.add(dungeonRoom.getMin().add(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)); - } - RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, true); + if (poses != null){ + RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, FeatureRegistry.SECRET_BROWSE.getThickness(), true); } } private int tick = -1; private PathEntity latest; + private List<BlockPos> poses; @Override public void onTick(DungeonRoom dungeonRoom) { tick = (tick+1) % 10; if (tick == 0) { latest = dungeonRoom.getPathFinder().createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE); + if (latest != null) { + poses = new ArrayList<>(); + for (int i = 0; i < latest.getCurrentPathLength(); i++) { + PathPoint pathPoint = latest.getPathPointFromIndex(i); + poses.add(dungeonRoom.getMin().add(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)); + } + } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java index f8969cc1..72f39115 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java @@ -48,26 +48,30 @@ public class ActionMoveNearestAir extends AbstractAction { RenderUtils.drawTextAtWorld(String.format("%.2f",MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())))+"m", pos.getX() + 0.5f, pos.getY() + 0.5f - scale, pos.getZ() + 0.5f, 0xFFFFFF00, 1f, true, false, partialTicks); if (FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() && Keybinds.togglePathfindStatus) return; - if (latest != null){ - List<BlockPos> poses = new ArrayList<BlockPos>(); - for (int i = 0; i < latest.getCurrentPathLength(); i++) { - PathPoint pathPoint = latest.getPathPointFromIndex(i); - poses.add(dungeonRoom.getMin().add(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)); - } - RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, true); + if (poses != null){ + RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, FeatureRegistry.SECRET_BROWSE.getThickness(), true); } } private int tick = -1; private PathEntity latest; + private List<BlockPos> poses; @Override public void onTick(DungeonRoom dungeonRoom) { tick = (tick+1) % 10; if (tick == 0) { latest = dungeonRoom.getPathFinder().createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE); + if (latest != null) { + poses = new ArrayList<>(); + for (int i = 0; i < latest.getCurrentPathLength(); i++) { + PathPoint pathPoint = latest.getPathPointFromIndex(i); + poses.add(dungeonRoom.getMin().add(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)); + } + } } } + @Override public String toString() { return "MoveNearestAir\n- target: "+target.toString(); |