Skip to content

Commit

Permalink
Update add back limits perms listener for limits reset #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume-Lebegue committed Nov 18, 2020
1 parent 2dfc9a8 commit 718828d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeleteEvent;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.limits.events.LimitsJoinPermCheckEvent;
import world.bentobox.upgrades.UpgradesAddon;

public class IslandChangeListener implements Listener {
Expand All @@ -14,7 +15,13 @@ public IslandChangeListener(UpgradesAddon addon) {
this.addon = addon;
}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = false)
public void onLimitsJoinPermCheckEvent(LimitsJoinPermCheckEvent e) {
// Stop LimitsJoinPermCheck else reset limits upgrades when player join
e.setCancelled(true);
}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = false)
public void onIslandDeleteEvent(IslandDeleteEvent e) {
Island island = e.getIsland();
this.addon.uncacheIsland(island.getUniqueId(), false);
Expand Down

0 comments on commit 718828d

Please sign in to comment.