3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Fix encoding of position

Huge thanks to those involved on this goose hunt.
Dieser Commit ist enthalten in:
Myles 2019-04-23 22:15:05 +01:00
Ursprung b4418c02ca
Commit 2e289a1d18

Datei anzeigen

@ -12,9 +12,10 @@ public class Position1_14Type extends Type<Position> {
@Override @Override
public Position read(ByteBuf buffer) { public Position read(ByteBuf buffer) {
long val = buffer.readLong(); long val = buffer.readLong();
long x = (val >> 38); long x = (val >> 38);
long y = val & 0xfff; long y = val << 52 >> 52;
long z = (((val << 38) >> 38)) >> 12; long z = val << 26 >> 38;
return new Position(x, y, z); return new Position(x, y, z);
} }