public void HandlePlayerPositionAndLook(MinecraftClient client, IPacket packet) { var myPacket = (CBPlayerPositionAndLook)packet; if (client.ThisPlayer == null) client.ThisPlayer = new Player(); client.ThisPlayer.location.x = myPacket.X; client.ThisPlayer.location.y = myPacket.Y; client.ThisPlayer.location.z = myPacket.Z; client.ThisPlayer.look[0] = myPacket.Yaw; client.ThisPlayer.look[1] = myPacket.Pitch; client.ThisPlayer.onGround = myPacket.OnGround; client.RaiseLocationChanged(); var sending = new SBPlayerPositionAndLook(); sending.X = client.ThisPlayer.location.x; sending.FeetY = client.ThisPlayer.location.y - 1.620; sending.HeadY = client.ThisPlayer.location.y; sending.Z = client.ThisPlayer.location.z; sending.Yaw = client.ThisPlayer.look[0]; sending.Pitch = client.ThisPlayer.look[1]; sending.OnGround = client.ThisPlayer.onGround; sending.Write(client.nh.wSock); }
public void HandlePlayerPositionAndLook(MinecraftClient client, IPacket packet) { var myPacket = (CbPlayerPositionAndLook)packet; if (client.ThisPlayer == null) client.ThisPlayer = new Player(); client.ThisPlayer.Location.X = myPacket.X; client.ThisPlayer.Location.Y = myPacket.Y; client.ThisPlayer.Location.Z = myPacket.Z; client.ThisPlayer.Look[0] = myPacket.Yaw; client.ThisPlayer.Look[1] = myPacket.Pitch; client.ThisPlayer.OnGround = myPacket.OnGround; client.RaiseLocationChanged(); var sending = new SbPlayerPositionAndLook { X = client.ThisPlayer.Location.X, FeetY = client.ThisPlayer.Location.Y - 1.620, HeadY = client.ThisPlayer.Location.Y, Z = client.ThisPlayer.Location.Z, Yaw = client.ThisPlayer.Look[0], Pitch = client.ThisPlayer.Look[1], OnGround = client.ThisPlayer.OnGround }; sending.Write(client.Nh.WSock); }