Skip to content

Commit

Permalink
Fix ordered waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Dec 31, 2024
1 parent 8e56d1a commit 8d879bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 8d879bd

Please sign in to comment.