From 5ec0f1b0983f47ae147eb0807d8c383f3eefd2d8 Mon Sep 17 00:00:00 2001 From: William278 Date: Sun, 10 Dec 2023 15:33:38 +0000 Subject: [PATCH] Support MC 1.20.4, improve timestamp exceptions --- bukkit/build.gradle | 2 +- .../main/java/net/william278/husksync/data/DataSnapshot.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bukkit/build.gradle b/bukkit/build.gradle index 53e065a4..9bce6045 100644 --- a/bukkit/build.gradle +++ b/bukkit/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation 'net.kyori:adventure-platform-bukkit:4.3.1' implementation 'dev.triumphteam:triumph-gui:3.1.7' implementation 'space.arim.morepaperlib:morepaperlib:0.4.3' - implementation 'de.tr7zw:item-nbt-api:2.12.1' + implementation 'de.tr7zw:item-nbt-api:2.12.2' compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' compileOnly 'commons-io:commons-io:2.15.1' diff --git a/common/src/main/java/net/william278/husksync/data/DataSnapshot.java b/common/src/main/java/net/william278/husksync/data/DataSnapshot.java index d636127e..772b6263 100644 --- a/common/src/main/java/net/william278/husksync/data/DataSnapshot.java +++ b/common/src/main/java/net/william278/husksync/data/DataSnapshot.java @@ -503,7 +503,10 @@ public class DataSnapshot { @NotNull public Builder timestamp(@NotNull OffsetDateTime timestamp) { if (timestamp.isAfter(OffsetDateTime.now())) { - throw new IllegalArgumentException("Data snapshots cannot have a timestamp set in the future"); + throw new IllegalArgumentException("Data snapshots cannot have a timestamp set in the future! " + + "Make sure your database server time matches the server time.\n" + + "Current game server timestamp: " + OffsetDateTime.now() + " / " + + "Snapshot timestamp: " + timestamp); } this.timestamp = timestamp; return this;