Fix instant sleep

This commit is contained in:
Minecon724 2024-12-05 20:32:39 +01:00
parent 94f6b62a28
commit 49c6139d99
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -39,7 +39,7 @@ public class SleepListener implements Listener {
if (!skippedCurrentNight.contains(event.getPlayer())) {
double onePlayerRatio = 1 / (event.getPlayer().getServer().getOnlinePlayers().size() * (world.getGameRuleValue(GameRule.PLAYERS_SLEEPING_PERCENTAGE) / 100.0));
world.setTime((long) ((23459 - world.getTime()) * onePlayerRatio));
world.setTime(Math.min(world.getTime() + (long) (10917 * onePlayerRatio), 23459));
skippedCurrentNight.add(event.getPlayer());
}
}