Support MC 1.20.4, improve timestamp exceptions

feat/data-edit-commands
William278 1 year ago
parent 8fad075357
commit 5ec0f1b098

@ -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'

@ -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;

Loading…
Cancel
Save