3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Use absolute day time value

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-09-26 12:15:03 +02:00
Ursprung e4e8297a82
Commit ce655d0679
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -113,8 +113,14 @@ public final class Protocol1_21To1_21_2 extends AbstractProtocol<ClientboundPack
registerClientbound(ClientboundPackets1_21.SET_TIME, wrapper -> { registerClientbound(ClientboundPackets1_21.SET_TIME, wrapper -> {
wrapper.passthrough(Types.LONG); // Game time wrapper.passthrough(Types.LONG); // Game time
final long dayTime = wrapper.passthrough(Types.LONG); long dayTime = wrapper.read(Types.LONG);
wrapper.write(Types.BOOLEAN, dayTime < 0); // Do daylight cycle boolean doDaylightCycle = true;
if (dayTime < 0) {
dayTime = -dayTime;
doDaylightCycle = false;
}
wrapper.write(Types.LONG, dayTime);
wrapper.write(Types.BOOLEAN, doDaylightCycle);
}); });
} }