This commit is contained in:
BONNe 2020-12-16 10:32:06 +02:00
parent 7215e88706
commit e1f27c88bd

View File

@ -26,8 +26,13 @@ public class ResetListener implements Listener {
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onIslandReset(IslandEvent e) { public void onIslandReset(IslandEvent e) {
if (e.getReason().equals(Reason.CREATED) || (addon.getChallengesSettings().isResetChallenges() && e.getReason().equals(Reason.RESETTED))) { if (addon.getChallengesSettings().isResetChallenges())
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner()); {
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());
}
} }
} }
} }