From e1f27c88bd5b078d957553aaec6c6fe02d9b666f Mon Sep 17 00:00:00 2001 From: BONNe Date: Wed, 16 Dec 2020 10:32:06 +0200 Subject: [PATCH] Fixes #265 --- .../bentobox/challenges/listeners/ResetListener.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/listeners/ResetListener.java b/src/main/java/world/bentobox/challenges/listeners/ResetListener.java index 294ea8d..182ff17 100644 --- a/src/main/java/world/bentobox/challenges/listeners/ResetListener.java +++ b/src/main/java/world/bentobox/challenges/listeners/ResetListener.java @@ -26,8 +26,13 @@ public class ResetListener implements Listener { @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()); + } } } }