From 80a807e36659710ed73be227bbf0c1c3a9f57185 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 20 May 2022 10:00:31 +0200 Subject: [PATCH] Fix head yaw and pitch being swapped for mob spawns --- .../protocol1_19to1_18_2/packets/EntityPackets.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java index eaa3af942..0c2056f95 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java @@ -199,8 +199,13 @@ public final class EntityPackets extends EntityRewriter { map(Type.DOUBLE); // X map(Type.DOUBLE); // Y map(Type.DOUBLE); // Z - map(Type.BYTE); // Yaw - map(Type.BYTE); // Pitch + handler(wrapper -> { + // Change order + final byte yaw = wrapper.read(Type.BYTE); + final byte pitch = wrapper.read(Type.BYTE); + wrapper.write(Type.BYTE, pitch); + wrapper.write(Type.BYTE, yaw); + }); map(Type.BYTE); // Head yaw create(Type.VAR_INT, 0); // Data map(Type.SHORT); // Velocity x