From 8ceabc97d507f897244f2826e5ec349da927778f Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 2 Oct 2021 13:55:24 +0200 Subject: [PATCH] No more Tasks --- .../src/de/steamwar/bausystem/region/BackupScheduler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/BackupScheduler.java b/BauSystem_Main/src/de/steamwar/bausystem/region/BackupScheduler.java index a132e920..e9b7ac8f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/BackupScheduler.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/BackupScheduler.java @@ -48,8 +48,10 @@ public class BackupScheduler implements Enable, Disable { @Override public void disable() { - final Iterator regions = Region.getREGION_MAP().values().stream().filter(region -> region.get(Tag.CHANGED)).iterator(); - BackupScheduler.this.doBackup(regions); + Region.getREGION_MAP().values().stream().filter(region -> region.get(Tag.CHANGED)).iterator().forEachRemaining(region -> { + region.backup(); + region.remove(Tag.CHANGED); + }); } public void doBackup(final Iterator regionIterator) {