diff options
author | nea <romangraef@gmail.com> | 2022-04-27 01:15:12 +0200 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-04-27 01:15:12 +0200 |
commit | f6da5e490729cf562c5384de99addefdc16ce93f (patch) | |
tree | ce3c66816d47db9a5ffb499b9c2b1c86bd74b02f | |
parent | 09a7b56f97e90fd7241a259e39079d56f377c392 (diff) | |
download | NotEnoughUpdates-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.java | 9 |
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; } } |