mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 23:21:24 +01:00
Merge pull request #402 from MrGazdag/patch-9
Fix timeRate 0 when time is 0
This commit is contained in:
commit
1fdf1d62f9
@ -416,7 +416,13 @@ public abstract class Instance implements BlockGetter, BlockSetter, Tickable, Ta
|
||||
* @return the {@link TimeUpdatePacket} with this instance data
|
||||
*/
|
||||
private @NotNull TimeUpdatePacket createTimePacket() {
|
||||
return new TimeUpdatePacket(worldAge, timeRate == 0 ? -Math.abs(time) : time);
|
||||
long time = this.time;
|
||||
if (timeRate == 0) {
|
||||
//Negative values stop the sun and moon from moving
|
||||
//0 as a long cannot be negative
|
||||
time = time == 0 ? -24000L : -Math.abs(time);
|
||||
}
|
||||
return new TimeUpdatePacket(worldAge, time);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user