From e26f03b0daf1a8992b77f55fbfb1150919e70e7d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:06:20 +0200 Subject: hiding ChumBucketHider NoSuchElementException error messages, reverting not working set wrapping --- .../at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/fishing') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt index 5f64aba8c..0bb98f8e4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt @@ -66,7 +66,15 @@ object ChumBucketHider { // Chum Bucket if (config.hideBucket.get() && entity.inventory.any { it != null && (it.name == "§fEmpty Chum Bucket" || it.name == "§aEmpty Chumcap Bucket") }) { val entityLocation = entity.getLorenzVec() - for (title in titleEntity.toSet()) { + val toSet = try { + titleEntity.toSet() + } catch (e: NoSuchElementException) { + // Caught an NoSuchElementException in ChumBucketHider at CheckRenderEntityEvent: null + // We know this happens, but we cant fix it, apparently. + // TODO fix it anyway + return + } + for (title in toSet) { if (entityLocation.equalsIgnoreY(title.getLorenzVec())) { hiddenEntities.add(entity) event.cancel() -- cgit