From 116b1d510cdb17cd0ce2b816f3be0d52200b8d8e Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Wed, 14 Dec 2022 18:34:30 +0100 Subject: [PATCH] Fix Exception in Backup engine --- .../pandacube/lib/paper/modules/backup/BackupManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/modules/backup/BackupManager.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/modules/backup/BackupManager.java index 37724b9..cead704 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/modules/backup/BackupManager.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/modules/backup/BackupManager.java @@ -15,6 +15,7 @@ import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldSaveEvent; import java.time.Instant; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Calendar; @@ -143,10 +144,9 @@ public class BackupManager implements Runnable, Listener { return 0; } - ZonedDateTime ldt = parsedScheduling.nextTimeAfter(ZonedDateTime.from(Instant.ofEpochMilli(dirtySince))); - // Log.info("Compress config: " + compressConfig + " - interval: " + interval); - - return ldt.toInstant().toEpochMilli(); + return parsedScheduling.nextTimeAfter(ZonedDateTime.ofInstant(Instant.ofEpochMilli(dirtySince), ZoneId.systemDefault())) + .toInstant() + .toEpochMilli(); }