Preserve rotation

This commit is contained in:
embeddedt 2023-10-07 17:42:04 -04:00
parent 204c8b78c4
commit 6593b6a5cf

View File

@ -18,7 +18,15 @@ public class ServerGamePacketListenerImplMixin {
if(player == this.player) {
// use positionRider
Vec3 oldPos = this.player.position();
yRot = this.player.yRot;
xRot = this.player.xRot;
float yHeadRot = this.player.getYHeadRot();
this.player.getRootVehicle().positionRider(this.player);
// keep old rotation
this.player.yRot = yRot;
this.player.xRot = xRot;
this.player.setYHeadRot(yHeadRot);
// save old position
this.player.xo = oldPos.x;
this.player.yo = oldPos.y;
this.player.zo = oldPos.z;