Fix between-ticks position of hand when spectating (fixes #563)

This commit is contained in:
Jonas Herzig
2021-08-17 19:07:55 +02:00
parent 0e5de6c816
commit 6428416bc4

View File

@@ -251,6 +251,26 @@ public class CameraEntity
updateBoundingBox();
}
//#if MC>=11400
@Override
public float getYaw(float tickDelta) {
Entity view = this.client.getCameraEntity();
if (view != null && view != this) {
return this.prevYaw + (this.yaw - this.prevYaw) * tickDelta;
}
return super.getYaw(tickDelta);
}
@Override
public float getPitch(float tickDelta) {
Entity view = this.client.getCameraEntity();
if (view != null && view != this) {
return this.prevPitch + (this.pitch - this.prevPitch) * tickDelta;
}
return super.getPitch(tickDelta);
}
//#endif
private void updateBoundingBox() {
//#if MC>=11400
float width = getWidth();