Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-23 23:00:35 +01:00
Properly compare against MIN/MAX_VALUE
Dieser Commit ist enthalten in:
Ursprung
545966a4e7
Commit
c8e33eef60
@ -24,8 +24,8 @@ class DoubleArgumentPropertySerializer implements ArgumentPropertySerializer<Dou
|
||||
|
||||
@Override
|
||||
public void serialize(DoubleArgumentType object, ByteBuf buf) {
|
||||
boolean hasMinimum = object.getMinimum() != Double.MIN_VALUE;
|
||||
boolean hasMaximum = object.getMaximum() != Double.MAX_VALUE;
|
||||
boolean hasMinimum = Double.compare(object.getMinimum(), Double.MIN_VALUE) != 0;
|
||||
boolean hasMaximum = Double.compare(object.getMaximum(), Double.MAX_VALUE) != 0;
|
||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||
|
||||
buf.writeByte(flag);
|
||||
|
@ -25,8 +25,8 @@ class FloatArgumentPropertySerializer implements ArgumentPropertySerializer<Floa
|
||||
|
||||
@Override
|
||||
public void serialize(FloatArgumentType object, ByteBuf buf) {
|
||||
boolean hasMinimum = object.getMinimum() != Float.MIN_VALUE;
|
||||
boolean hasMaximum = object.getMaximum() != Float.MAX_VALUE;
|
||||
boolean hasMinimum = Float.compare(object.getMinimum(), Float.MIN_VALUE) != 0;
|
||||
boolean hasMaximum = Float.compare(object.getMaximum(), Float.MAX_VALUE) != 0;
|
||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||
|
||||
buf.writeByte(flag);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren