This commit is contained in:
BONNe 2020-12-16 10:32:06 +02:00
parent 7215e88706
commit e1f27c88bd
1 changed files with 7 additions and 2 deletions

View File

@ -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());
}
}
}
}