From f6da5e490729cf562c5384de99addefdc16ce93f Mon Sep 17 00:00:00 2001 From: nea Date: Wed, 27 Apr 2022 01:15:12 +0200 Subject: fix teleporter navigation because apparently i cant --- .../moulberry/notenoughupdates/miscfeatures/Navigation.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java index a8f3ea9f..93c2692b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java @@ -133,16 +133,15 @@ public class Navigation { ); island = currentlyTrackedWaypoint.get("island").getAsString(); displayName = currentlyTrackedWaypoint.get("displayname").getAsString(); - recalculateNextTeleporter(); + recalculateNextTeleporter(SBInfo.getInstance().mode); } @SubscribeEvent public void onLocationChange(LocationChangeEvent event) { - recalculateNextTeleporter(); + recalculateNextTeleporter(event.newLocation); } - public Teleporter recalculateNextTeleporter() { - String from = SBInfo.getInstance().mode; + public Teleporter recalculateNextTeleporter(String from) { String to = island; if (from == null || to == null) return null; List nextTeleporter = findNextTeleporter0(from, to, new HashSet<>()); @@ -166,7 +165,7 @@ public class Navigation { if (nextTeleporter0 == null) continue; if (minPath == null || nextTeleporter0.size() < minPathLength) { minPathLength = nextTeleporter0.size(); - nextTeleporter0.add(teleporter); + nextTeleporter0.add(0, teleporter); minPath = nextTeleporter0; } } -- cgit