aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-22 13:37:15 +0900
committersyeyoung <cyong06@naver.com>2021-02-22 13:37:15 +0900
commit4d0beb048ef798656cf4db5b340daae4a3ddd8de (patch)
tree7e42cc5e62ce8e7652412a8d903bf04ee185e37c /src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions
parent4f289db303d4e68e68789767b91e3106ff1866d7 (diff)
downloadSkyblock-Dungeons-Guide-4d0beb048ef798656cf4db5b340daae4a3ddd8de.tar.gz
Skyblock-Dungeons-Guide-4d0beb048ef798656cf4db5b340daae4a3ddd8de.tar.bz2
Skyblock-Dungeons-Guide-4d0beb048ef798656cf4db5b340daae4a3ddd8de.zip
a bit better pathfinding and a toggle
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java3
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java12
2 files changed, 13 insertions, 2 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 2fc86b8e..f0e77c55 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java
@@ -1,7 +1,9 @@
package kr.syeyoung.dungeonsguide.dungeon.actions;
+import kr.syeyoung.dungeonsguide.Keybinds;
import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import lombok.Data;
import net.minecraft.client.Minecraft;
@@ -46,6 +48,7 @@ public class ActionMove extends AbstractAction {
RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, (float) (pos.getY() + 0.5f + scale), pos.getZ() + 0.5f, 0xFF00FF00, 1f, true, false, partialTicks);
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>();
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 3f8e4061..01822292 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java
@@ -1,7 +1,9 @@
package kr.syeyoung.dungeonsguide.dungeon.actions;
+import kr.syeyoung.dungeonsguide.Keybinds;
import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import lombok.Data;
import net.minecraft.client.Minecraft;
@@ -38,8 +40,14 @@ public class ActionMoveNearestAir extends AbstractAction {
@Override
public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks) {
BlockPos pos = target.getBlockPos(dungeonRoom);
- RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, pos.getY() + 0.6f, pos.getZ() + 0.5f, 0xFF00FF00, 1f, true, false, partialTicks);
- RenderUtils.drawTextAtWorld(String.format("%.2f",MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())))+"m", pos.getX() + 0.5f, pos.getY() + 0.3f, pos.getZ() + 0.5f, 0xFFFFFF00, 1f, true, false, partialTicks);
+ float distance = MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()));
+ float multiplier = distance / 120f; //mobs only render ~120 blocks away
+ float scale = 0.45f * multiplier;
+ scale *= 25.0 / 6.0;
+ RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, (float) (pos.getY() + 0.5f + scale), pos.getZ() + 0.5f, 0xFF00FF00, 1f, true, false, partialTicks);
+ 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++) {