Skip to content

Commit

Permalink
Fixes #265
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Dec 16, 2020
1 parent 7215e88 commit e1f27c8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ public ResetListener(ChallengesAddon addon) {

@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onIslandReset(IslandEvent e) {
if (e.getReason().equals(Reason.CREATED) || (addon.getChallengesSettings().isResetChallenges() && e.getReason().equals(Reason.RESETTED))) {
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
if (addon.getChallengesSettings().isResetChallenges())
{
if (e.getReason().equals(IslandEvent.Reason.CREATED) ||
e.getReason().equals(IslandEvent.Reason.RESETTED) ||
e.getReason().equals(IslandEvent.Reason.REGISTERED)) {
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
}
}
}
}

0 comments on commit e1f27c8

Please sign in to comment.