Players appear offset for other clients after going through nether portals
When you leave or enter the nether in multiplayer you don't appear at the right location for other clients.
This video shows the bug: http://youtu.be/c1zM8gFB3ro
Here is why this happens: When a player goes through a portal his x- and z-coordinate get multiplied/divided by 8. Then the entity gets spawned in to other dimension.
And after that the player gets moved into the portal where he should spawn. But the last repositioning isn't send to the other clients. Therefor they see the player at x*8, y, z*8 or x/8, y, z/8 (depending if the player left or entered the nether).
To fix this bug we either need to send the absolute coordinates to the other clients after the repositioning or to place the player in the portal before it gets spawned into the world.
Here is how I programmed the second fix with MCP:
In ServerConfigurationManager.java I changed line 507 to 510 from
par4WorldServer.spawnEntityInWorld(par1Entity); //Spawns the entity par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch); //Sets the position to x*8, y, z*8 or x/8, y, z/8. The values were calculated earlier par4WorldServer.updateEntityWithOptionalForce(par1Entity, false); par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, var11, var13, var15, var17); //Repositions the entity into the portal //The comments where added by me
to
par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch); //Sets the position to x*8, y, z*8 or x/8, y, z/8. The values were calculated earlier par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, var11, var13, var15, var17); //Repositions the entity into the portal par4WorldServer.spawnEntityInWorld(par1Entity); //Spawns the entity par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);
The screenshot is showing a player who came through the portal breaking a block. You can see him in the background due to the offset.
FOR MODERATORS:
Since the other two posts on this bug miss out on a lot of important information I decided to repost it. If you mark this bug as duplicate please make sure to make the information visible in the other posts. Thank you!
This issues was posted two times before:
https://mojang.atlassian.net/browse/MC-12608
https://mojang.atlassian.net/browse/MC-17345
2013-09-04, 08:52 PM
2017-05-11, 12:15 PM
2013-10-21, 01:18 PM
127
9
invisible, nether_portal, offset, player, position