Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/main/java/meteordevelopment/meteorclient/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ public static Vec3 getPlayerSpeed() {
public static String getWorldTime() {
if (mc.level == null) return "00:00";

int ticks = (int) (mc.level.getGameTime() % 24000);
ticks += 6000;
if (ticks > 24000) ticks -= 24000;
// Since 26.1 the day/night cycle runs on World Clocks; getGameTime() is the world
// age and is unaffected by /time, so it must not be used for time of day.
long ticks = Math.floorMod(mc.level.getDefaultClockTime(), 24000L);
ticks = (ticks + 6000L) % 24000L;

return String.format("%02d:%02d", ticks / 1000, (int) (ticks % 1000 / 1000.0 * 60));
}
Expand Down