From 0401cb030a57765eb5d0eff36453add731b69e03 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sat, 21 Aug 2021 14:11:39 +0200 Subject: only show waypoints when in mines of divan --- .../notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | 3 ++- .../java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java index 357d8326..73e2b412 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -81,7 +81,8 @@ public class CrystalMetalDetectorSolver { } public static void render(float partialTicks) { - if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows")) { + if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows") && + SBInfo.getInstance().location.equals("Mines of Divan")) { if (possibleBlocks.size() == 1) { RenderUtils.renderWayPoint("Treasure", possibleBlocks.get(0).add(0, 2.5, 0), partialTicks); } else if (possibleBlocks.size() > 1 && NotEnoughUpdates.INSTANCE.config.mining.metalDetectorShowPossible) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 243ee151..c837fc5f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -194,7 +194,12 @@ public class SBInfo { currentTimeDate = parseFormat.parse(timeSpace); } catch (ParseException e) {} } - location = Utils.cleanColour(lines.get(3)).replaceAll("[^A-Za-z0-9() ]", "").trim(); + //Replaced with for loop because in crystal hollows with events the line it's on can shift. + for (String line : lines){ + if (line.contains("⏣")) { + location = Utils.cleanColour(line).replaceAll("[^A-Za-z0-9() ]", "").trim(); + } + } } objective = null; -- cgit