Skip to content

Commit

Permalink
refactor: Replace hardcoded constant with DAY_LENGTH
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveplays28 committed Oct 2, 2023
1 parent d59c806 commit 72d0458
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 72d0458

Please sign in to comment.