Skip to content

Commit

Permalink
Fixes island deletion handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Feb 9, 2019
1 parent 337635d commit 3f120a4
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import bentobox.addon.limits.Limits;
import bentobox.addon.limits.objects.IslandBlockCount;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeletedEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeleteEvent;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.Database;
Expand Down Expand Up @@ -274,10 +274,12 @@ private int checkLimit(World w, Material m, String id) {
* @param e - island delete event
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onIslandDelete(IslandDeletedEvent e) {
public void onIslandDelete(IslandDeleteEvent e) {
countMap.remove(e.getIsland().getUniqueId());
saveMap.remove(e.getIsland().getUniqueId());
handler.deleteID(e.getIsland().getUniqueId());
if (handler.objectExists(e.getIsland().getUniqueId())) {
handler.deleteID(e.getIsland().getUniqueId());
}
}

}

0 comments on commit 3f120a4

Please sign in to comment.