mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 01:55:47 +01:00
Use absolute day time value
This commit is contained in:
parent
e4e8297a82
commit
ce655d0679
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user