From ce655d0679276054ed6d6c824a45cda8d4b1b277 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 26 Sep 2024 12:15:03 +0200 Subject: [PATCH] Use absolute day time value --- .../protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java index 1159c7bb3..8b78691e7 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java @@ -113,8 +113,14 @@ public final class Protocol1_21To1_21_2 extends AbstractProtocol { wrapper.passthrough(Types.LONG); // Game time - final long dayTime = wrapper.passthrough(Types.LONG); - wrapper.write(Types.BOOLEAN, dayTime < 0); // Do daylight cycle + long dayTime = wrapper.read(Types.LONG); + boolean doDaylightCycle = true; + if (dayTime < 0) { + dayTime = -dayTime; + doDaylightCycle = false; + } + wrapper.write(Types.LONG, dayTime); + wrapper.write(Types.BOOLEAN, doDaylightCycle); }); }