public static void PlayerPositionAndLook(MinecraftClient client, IPacket _packet) { var packet = (PlayerPositionAndLookPacket)_packet; client._position = new Vector3(packet.X, packet.Stance, packet.Z); if (!client.IsSpawned) { client.IsSpawned = true; client.OnInitialSpawn(new EntitySpawnEventArgs(client.Position, client.EntityId)); } client.SendPacket(new PlayerPositionPacket(packet.X, packet.Stance, packet.Z, packet.Y, true)); }
public static void PlayerPositionAndLook(MinecraftClient client, IPacket _packet) { var packet = (PlayerPositionAndLookPacket)_packet; if (Math.Abs(packet.X) < 0.01 && Math.Abs(packet.X) > 0) return; // Sometimes the vanilla server sends weird position updates like this client._position = new Vector3(packet.X, packet.Y, packet.Z); if (!client.IsSpawned) { client.IsSpawned = true; client.OnInitialSpawn(new EntitySpawnEventArgs(client.Position, client.EntityId)); } client.SendPacket(new PlayerPositionPacket(client.Position.X, client.Position.Y, client.Position.Z, client.Position.Y - 1.62, true)); }
public static void PlayerPositionAndLook(MinecraftClient client, IPacket _packet) { var packet = (PlayerPositionAndLookPacket)_packet; client._position = new Vector3(packet.X, packet.Stance, packet.Z); if (!client.IsSpawned) { client.IsSpawned = true; client.OnInitialSpawn(new EntitySpawnEventArgs(client.Position, client.EntityId)); } client.SendPacket(new PlayerPositionPacket(packet.X, packet.Stance, packet.Z, packet.Y, true)); }
public static void PlayerPositionAndLook(MinecraftClient client, IPacket _packet) { var packet = (PlayerPositionAndLookPacket)_packet; if (Math.Abs(packet.X) < 0.01 && Math.Abs(packet.X) > 0) { return; // Sometimes the vanilla server sends weird position updates like this } client.Position = new Vector3(packet.X, packet.Y, packet.Z); if (!client.IsSpawned) { client.IsSpawned = true; client.OnInitialSpawn(new EntitySpawnEventArgs(client.Position, client.EntityId)); } client.SendPacket(new PlayerPositionPacket(client.Position.X, client.Position.Y, client.Position.Z, client.Position.Y - 1.62, true)); }