You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.
As you can see, readInt() and readLong() take care of the endian ness, but readFloat() and readDouble() also try to take care of flipping the bytes around! This causes LITTLE_ENDIAN Floats and Doubles to be read as BIG_ENDIAN.
public float readFloat() throws IOException {
return Float.intBitsToFloat(readInt());
}
public double readDouble() throws IOException {
return Double.longBitsToDouble(readLong());
}
That should fix it.
If someone could sneak that into there next PR that would be nice! ;) Fixed in PR #16
The text was updated successfully, but these errors were encountered:
https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/stream/EndianSwitchableInputStream.java#L100-L122
As you can see, readInt() and readLong() take care of the endian ness, but readFloat() and readDouble() also try to take care of flipping the bytes around! This causes LITTLE_ENDIAN Floats and Doubles to be read as BIG_ENDIAN.
That should fix it.
If someone could sneak that into there next PR that would be nice! ;)Fixed in PR #16The text was updated successfully, but these errors were encountered: