From 2e289a1d18f532340d6a2621cc26fda3fa29235f Mon Sep 17 00:00:00 2001 From: Myles Date: Tue, 23 Apr 2019 22:15:05 +0100 Subject: [PATCH] Fix encoding of position Huge thanks to those involved on this goose hunt. --- .../api/type/types/minecraft/Position1_14Type.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/Position1_14Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/Position1_14Type.java index 05543d43b..fe4d2a3f6 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/Position1_14Type.java +++ b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/Position1_14Type.java @@ -12,9 +12,10 @@ public class Position1_14Type extends Type { @Override public Position read(ByteBuf buffer) { long val = buffer.readLong(); + long x = (val >> 38); - long y = val & 0xfff; - long z = (((val << 38) >> 38)) >> 12; + long y = val << 52 >> 52; + long z = val << 26 >> 38; return new Position(x, y, z); }