use -Math.abs() instead

This commit is contained in:
MrGazdag 2021-07-27 20:50:17 +02:00 committed by GitHub
parent f35bcb90b9
commit 24ee50d69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,7 +405,7 @@ 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 ? -time : time);
return new TimeUpdatePacket(worldAge, timeRate == 0 ? -Math.abs(time) : time);
}
/**