Don't let player loot if reloot time is disabled (#9615)

If the reloot time is disabled while reloot is restricted, the player
should not be able to reloot. The previous logic was incorrect and
allowed players to reloot explicitly when the reloot time was disabled.
This commit is contained in:
Bjarne Koll 2023-08-16 06:08:00 +02:00
parent 49502449bb
commit f5719c0b4a

View file

@ -419,7 +419,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (!worldConfiguration.lootables.restrictPlayerReloot || lastLooted == null) return true;
+
+ final DurationOrDisabled restrictPlayerRelootTime = worldConfiguration.lootables.restrictPlayerRelootTime;
+ if (restrictPlayerRelootTime.value().isEmpty()) return true;
+ if (restrictPlayerRelootTime.value().isEmpty()) return false;
+
+ return TimeUnit.SECONDS.toMillis(restrictPlayerRelootTime.value().get().seconds()) + lastLooted < System.currentTimeMillis();
+ }