From 72d045836a1c9821578961ad0b344f987b29200b Mon Sep 17 00:00:00 2001 From: Steveplays28 Date: Mon, 2 Oct 2023 20:09:26 +0200 Subject: [PATCH] refactor: Replace hardcoded constant with `DAY_LENGTH` --- .../steveplays28/realisticsleep/mixin/ServerWorldMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/steveplays28/realisticsleep/mixin/ServerWorldMixin.java b/src/main/java/com/github/steveplays28/realisticsleep/mixin/ServerWorldMixin.java index 3e5169c..0d03c88 100644 --- a/src/main/java/com/github/steveplays28/realisticsleep/mixin/ServerWorldMixin.java +++ b/src/main/java/com/github/steveplays28/realisticsleep/mixin/ServerWorldMixin.java @@ -78,7 +78,7 @@ public void tickInject(BooleanSupplier shouldKeepTicking, CallbackInfo ci) { int sleepingPlayerCount = sleepManager.getSleeping(); // TODO: Don't assume the TPS is 20 int secondsUntilAwake = Math.abs( - SleepMath.calculateSecondsUntilAwake((int) worldProperties.getTimeOfDay() % 24000, nightTimeStepPerTick, 20)); + SleepMath.calculateSecondsUntilAwake((int) worldProperties.getTimeOfDay() % DAY_LENGTH, nightTimeStepPerTick, 20)); // Check if the night has (almost) ended and the weather should be skipped if (secondsUntilAwake <= 2 && shouldSkipWeather) {