diff --git a/MCGalaxy/Network/Player.Networking.cs b/MCGalaxy/Network/Player.Networking.cs index 0353d3a12..9daf3c0f7 100644 --- a/MCGalaxy/Network/Player.Networking.cs +++ b/MCGalaxy/Network/Player.Networking.cs @@ -353,7 +353,10 @@ namespace MCGalaxy { /// Sends a packet indicating an entity was spawned in the current map /// at the given absolute position + coordinates - public void SendSpawn(byte id, string name, ushort x, ushort y, ushort z, byte rotx, byte roty) { + public void SendSpawn(byte id, string name, ushort x, ushort y, ushort z, byte rotx, byte roty) { + // NOTE: Fix for standard clients + if (id == Entities.SelfID) y -= 22; + byte[] buffer = new byte[74]; buffer[0] = Opcode.AddEntity; buffer[1] = id; @@ -453,6 +456,9 @@ namespace MCGalaxy { } public void SendExtAddEntity2(byte id, string skinName, string displayName, ushort x, ushort y, ushort z, byte rotx, byte roty) { + // NOTE: Fix for standard clients + if (id == Entities.SelfID) y -= 22; + byte[] buffer = new byte[138]; buffer[0] = Opcode.CpeExtAddEntity2; buffer[1] = id; diff --git a/MCGalaxy/Player/Player.Login.cs b/MCGalaxy/Player/Player.Login.cs index 54d7bf3ea..fadac20a1 100644 --- a/MCGalaxy/Player/Player.Login.cs +++ b/MCGalaxy/Player/Player.Login.cs @@ -166,9 +166,9 @@ namespace MCGalaxy { Game.InfectMessages = PlayerDB.GetInfectMessages(this); Server.zombie.PlayerJoinedServer(this); - ushort x = (ushort)((0.5 + level.spawnx) * 32); - ushort y = (ushort)((1 + level.spawny) * 32); - ushort z = (ushort)((0.5 + level.spawnz) * 32); + ushort x = (ushort)(level.spawnx * 32 + 16); + ushort y = (ushort)(level.spawny * 32 + 32); + ushort z = (ushort)(level.spawnz * 32 + 16); pos = new ushort[3] { x, y, z }; rot = new byte[2] { level.rotx, level.roty };