From 08078a7b2bd94e6d0522a75039a49b5755b96d26 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:38:01 +0100 Subject: Fixed error when king talisman helper does not find the king in range. --- .../java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt index 501ae420e..93e12cc6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt @@ -83,7 +83,7 @@ class KingTalismanHelper { private fun checkOffset() { val king = EntityUtils.getEntitiesNearby(LorenzVec(129.6, 196.0, 196.7), 2.0) - .filter { it.name.startsWith("§6§lKing ") }.first() + .filter { it.name.startsWith("§6§lKing ") }.firstOrNull() ?: return val foundKing = "§6§lKing (?.*)".toPattern().matchMatcher(king.name) { group("name") } ?: return -- cgit