From 8d879bd1c95656d39067fdfc9093d89cb7cc7e56 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:36:09 -0800 Subject: [PATCH] Fix ordered waypoints --- .../hysky/skyblocker/utils/waypoint/OrderedNamedWaypoint.java | 3 +++ .../java/de/hysky/skyblocker/utils/waypoint/WaypointGroup.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/OrderedNamedWaypoint.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/OrderedNamedWaypoint.java index 647b15da4d..2978b88300 100644 --- a/src/main/java/de/hysky/skyblocker/utils/waypoint/OrderedNamedWaypoint.java +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/OrderedNamedWaypoint.java @@ -77,6 +77,9 @@ public float[] getRenderColorComponents() { @Override public void render(WorldRenderContext context) { super.render(context); + if (relativeIndex == RelativeIndex.NEXT && shouldRender()) { + RenderHelper.renderLineFromCursor(context, centerPos, getRenderColorComponents(), 1f, DEFAULT_LINE_WIDTH); + } if (shouldRenderName()) { float scale = Math.max((float) context.camera().getPos().distanceTo(centerPos) / 10, 1); RenderHelper.renderText(context, Text.of(String.valueOf(index + 1)), centerPos.add(0, 1, 0), scale, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true); diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointGroup.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointGroup.java index fe8c99cc70..3add490dce 100644 --- a/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointGroup.java +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointGroup.java @@ -107,7 +107,7 @@ public NamedWaypoint convertWaypoint(NamedWaypoint waypoint) { } public void render(WorldRenderContext context) { - if (ordered) { + if (ordered && !waypoints.isEmpty()) { for (int i = 0; i < waypoints.size(); i++) { NamedWaypoint waypoint = waypoints.get(i); if (waypoint.pos.isWithinDistance(MinecraftClient.getInstance().player.getPos(), WAYPOINT_ACTIVATION_RADIUS)) {