Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 23:30:26 +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
|
@Override
|
||||||
public void serialize(DoubleArgumentType object, ByteBuf buf) {
|
public void serialize(DoubleArgumentType object, ByteBuf buf) {
|
||||||
boolean hasMinimum = object.getMinimum() != Double.MIN_VALUE;
|
boolean hasMinimum = Double.compare(object.getMinimum(), Double.MIN_VALUE) != 0;
|
||||||
boolean hasMaximum = object.getMaximum() != Double.MAX_VALUE;
|
boolean hasMaximum = Double.compare(object.getMaximum(), Double.MAX_VALUE) != 0;
|
||||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||||
|
|
||||||
buf.writeByte(flag);
|
buf.writeByte(flag);
|
||||||
|
@ -25,8 +25,8 @@ class FloatArgumentPropertySerializer implements ArgumentPropertySerializer<Floa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(FloatArgumentType object, ByteBuf buf) {
|
public void serialize(FloatArgumentType object, ByteBuf buf) {
|
||||||
boolean hasMinimum = object.getMinimum() != Float.MIN_VALUE;
|
boolean hasMinimum = Float.compare(object.getMinimum(), Float.MIN_VALUE) != 0;
|
||||||
boolean hasMaximum = object.getMaximum() != Float.MAX_VALUE;
|
boolean hasMaximum = Float.compare(object.getMaximum(), Float.MAX_VALUE) != 0;
|
||||||
byte flag = getFlags(hasMinimum, hasMaximum);
|
byte flag = getFlags(hasMinimum, hasMaximum);
|
||||||
|
|
||||||
buf.writeByte(flag);
|
buf.writeByte(flag);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren