mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-07 08:58:20 +01:00
fix time 0
This commit is contained in:
parent
ae3884efdc
commit
4fc5b4f6c9
@ -416,7 +416,15 @@ public abstract class Instance implements BlockGetter, BlockSetter, Tickable, Ta
|
|||||||
* @return the {@link TimeUpdatePacket} with this instance data
|
* @return the {@link TimeUpdatePacket} with this instance data
|
||||||
*/
|
*/
|
||||||
private @NotNull TimeUpdatePacket createTimePacket() {
|
private @NotNull TimeUpdatePacket createTimePacket() {
|
||||||
return new TimeUpdatePacket(worldAge, timeRate == 0 ? -Math.abs(time) : time);
|
long timeOfDay;
|
||||||
|
if (timeRate == 0) {
|
||||||
|
//Negative values make the sun and moon stop moving
|
||||||
|
//0 as a long cannot be negative
|
||||||
|
timeOfDay = time == 0 ? -24000L : -Math.abs(time);
|
||||||
|
} else {
|
||||||
|
timeOfDay = time;
|
||||||
|
}
|
||||||
|
return new TimeUpdatePacket(worldAge, timeOfDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user