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() }