Merge remote-tracking branch 'origin/new-block-api' into new-block-api

This commit is contained in:
TheMode 2021-08-11 14:18:19 +02:00
commit 6773ea73ef

View File

@ -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);
}
/**