From 21e14cfddb0d0a22d031332caab2f5f51dc6880e Mon Sep 17 00:00:00 2001 From: olim88 Date: Mon, 21 Oct 2024 05:48:49 +0100 Subject: fix kings scent detection for wishing compass (#1012) --- .../skyblocker/skyblock/dwarven/WishingCompassSolver.java | 14 +++++++++----- src/main/resources/assets/skyblocker/lang/en_us.json | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/WishingCompassSolver.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/WishingCompassSolver.java index 3b49c903..964131ec 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/WishingCompassSolver.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/WishingCompassSolver.java @@ -103,11 +103,15 @@ public class WishingCompassSolver { } private static boolean isKingsScentPresent() { - String footer = PlayerListMgr.getFooter(); - if (footer == null) { - return false; - } - return footer.contains("King's Scent I"); + if (CLIENT.player == null) { + return false; + } + //make sure the data is in tab and if not tell the user + if (PlayerListMgr.getPlayerStringList().stream().noneMatch(entry -> entry.startsWith("Active Effects:"))) { + CLIENT.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.enableTabEffectsMessage")), false); + return false; + } + return PlayerListMgr.getPlayerStringList().stream().anyMatch(entry -> entry.startsWith("King's Scent")); } private static boolean isKeyInInventory() { diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index e9b558cb..172019ff 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -561,6 +561,7 @@ "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver": "Wishing Compass Solver", "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.@Tooltip": "Calculates and adds a waypoint at the location indicated by wishing compasses.", "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.enableTabMessage": "Enable crystals in the /tab to allow the compass to identify discovered items", + "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.enableTabEffectsMessage": "Enable effects in the /tab to allow the compass to identify queen coordinates", "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.wishingCompassUsedMessage": "Wishing compass used. Move to another location and use a second compass to triangulate the target", "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.somethingWentWrongMessage": "The lines did not intersect (Something went wrong) please try again.", "skyblocker.config.mining.crystalsWaypoints.wishingCompassSolver.targetLocationToFar": "The target location is too far away to identify the structure, possibly due to a missing structure in the lobby.", -- cgit