3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +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 -> {
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);
});
}