尝试添加乘客视角限制

This commit is contained in:
17146 2025-01-03 02:27:19 +08:00
parent af54a10135
commit daa8c777d2
2 changed files with 9 additions and 1 deletions

View file

@ -217,7 +217,16 @@ public class Ah6Entity extends MobileVehicleEntity implements GeoEntity, IHelico
entity.setYBodyRot(this.getYRot());
float f2 = Mth.wrapDegrees(entity.getYRot() - this.getYRot());
int i = this.getPassengers().indexOf(entity);
float f3 = Mth.clamp(f2, -80.0F, 80.0F);
if (i == 2) {
f3 = Mth.clamp(f2, -160.0F, -20.0F);
}
if (i == 3) {
f3 = Mth.clamp(f2, 20.0F, 160.0F);
}
entity.yRotO += f3 - f2;
entity.setYRot(entity.getYRot() + f3 - f2);
entity.setYHeadRot(entity.getYRot());

View file

@ -322,7 +322,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I
}
}
Level level = player.level();
final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ());