From 9749a3199aa3783de7fe40a3ceac99a16b93c23e Mon Sep 17 00:00:00 2001 From: illyum <90023277+itzilly@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:13:08 -0600 Subject: [PATCH] (BugFix): Recheck chest locations to remove ghost chest highlights --- .../kotlin/com/github/itzilly/sbt/features/ChestEsp.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt b/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt index 087e456..a4834a8 100644 --- a/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt +++ b/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt @@ -63,6 +63,15 @@ object ChestEsp { val pos = event.pos if (chestNodeExists(pos.x, pos.y, pos.z)) { chestList.removeIf { it.x == pos.x && it.y == pos.y && it.z == pos.z } + checkChestLocations() + } + } + } + + fun checkChestLocations() { + for (chest in chestList) { + if (chestNodeExists(chest.x, chest.y, chest.z)) { + chestList.removeIf { it.x == chest.x && it.y == chest.y && it.z == chest.z } } } } @@ -97,6 +106,7 @@ object ChestEsp { } } } + checkChestLocations() }