Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 20:43:04 +02:00
Make all moon phases visible
The fix to prevent integer overflows also prevented moon phases from being visible until now. Fixes #2927
Dieser Commit ist enthalten in:
Ursprung
cb8858fc42
Commit
98db9c6948
@ -42,7 +42,10 @@ public class JavaSetTimeTranslator extends PacketTranslator<ClientboundSetTimePa
|
||||
|
||||
// https://minecraft.gamepedia.com/Day-night_cycle#24-hour_Minecraft_day
|
||||
SetTimePacket setTimePacket = new SetTimePacket();
|
||||
setTimePacket.setTime((int) Math.abs(time) % 24000);
|
||||
// We use modulus to prevent an integer overflow
|
||||
// 24000 is the range of ticks that a Minecraft day can be; we times by 8 so all moon phases are visible
|
||||
// (Last verified behavior: Bedrock 1.18.12 / Java 1.18.2)
|
||||
setTimePacket.setTime((int) Math.abs(time) % (24000 * 8));
|
||||
session.sendUpstreamPacket(setTimePacket);
|
||||
if (!session.isDaylightCycle() && time >= 0) {
|
||||
// Client thinks there is no daylight cycle but there is
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren