aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-04-27 01:15:12 +0200
committernea <romangraef@gmail.com>2022-04-27 01:15:12 +0200
commitf6da5e490729cf562c5384de99addefdc16ce93f (patch)
treece3c66816d47db9a5ffb499b9c2b1c86bd74b02f
parent09a7b56f97e90fd7241a259e39079d56f377c392 (diff)
downloadNotEnoughUpdates-f6da5e490729cf562c5384de99addefdc16ce93f.tar.gz
NotEnoughUpdates-f6da5e490729cf562c5384de99addefdc16ce93f.tar.bz2
NotEnoughUpdates-f6da5e490729cf562c5384de99addefdc16ce93f.zip
fix teleporter navigation because apparently i cant
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java9
1 files 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<Teleporter> 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;
}
}