mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Fix numerical attribute encoding
This commit is contained in:
@@ -30,13 +30,13 @@ public final class NumericalAttribute extends Attribute<Number> {
|
||||
|
||||
@Override
|
||||
public byte[] encode() {
|
||||
long encoded = type == AttributeType.DOUBLE ? Double.doubleToLongBits((double) value) : (long) value;
|
||||
long encoded = type == AttributeType.DOUBLE ? Double.doubleToLongBits(value.doubleValue()) : value.longValue();
|
||||
return Longs.toByteArray(encoded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return type == AttributeType.DOUBLE ? Double.toString((double) value) : Long.toString((long) value);
|
||||
return type == AttributeType.DOUBLE ? Double.toString(value.doubleValue()) : Long.toString(value.longValue());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user