From 3a53f5512e4ee081d44198dcde3b2ca15b91f3e9 Mon Sep 17 00:00:00 2001 From: Chirag Date: Sun, 9 Aug 2026 04:57:39 +0530 Subject: [PATCH] Validate lootables refresh range at config load --- .../io/papermc/paper/configuration/WorldConfiguration.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-server/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/paper-server/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java index 86ae93a9cad3..20f796a1dfaa 100644 --- a/paper-server/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/paper-server/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java @@ -385,6 +385,13 @@ public class Lootables extends ConfigurationPart { public Duration refreshMin = Duration.of("12h"); public Duration refreshMax = Duration.of("2d"); public boolean retainUnlootedShulkerBoxLootTableOnNonPlayerBreak = true; + + @PostProcess + public void validateRefillRange() throws SerializationException { + if (this.refreshMax.seconds() < this.refreshMin.seconds()) { + throw new SerializationException("lootables.refresh-max (%s) must be greater than or equal to lootables.refresh-min (%s)".formatted(this.refreshMax.value(), this.refreshMin.value())); + } + } } public MaxGrowthHeight maxGrowthHeight;