More code to clean up when an island is deleted. #2456

This commit is contained in:
tastybento 2024-08-05 12:22:32 -07:00
parent 0766f2967d
commit c9c57e113f

View File

@ -171,8 +171,15 @@ public class IslandCache {
}
private void removeFromIslandsByUUID(Island island) {
for (Set<String> set : islandsByUUID.values()) {
Iterator<Map.Entry<UUID, Set<String>>> iterator = islandsByUUID.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<UUID, Set<String>> entry = iterator.next();
Set<String> set = entry.getValue();
set.removeIf(island.getUniqueId()::equals);
if (set.isEmpty()) {
// Removes the overall entry if there is nothing left in the set
iterator.remove();
}
}
}