调整武器站跟随炮塔旋转逻辑
This commit is contained in:
parent
59e59cf285
commit
d85b7150f3
1 changed files with 15 additions and 13 deletions
|
@ -590,8 +590,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
|
||||
private void turretAngle() {
|
||||
Entity driver = this.getFirstPassenger();
|
||||
if (!(driver instanceof Player)) return;
|
||||
|
||||
if (driver != null) {
|
||||
float turretAngle = -Mth.wrapDegrees(driver.getYHeadRot() - this.getYRot());
|
||||
|
||||
float diffY;
|
||||
|
@ -608,6 +607,9 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
this.setTurretXRot(Mth.clamp(this.getTurretXRot() + Mth.clamp(0.95f * diffX, -5, 5), -30f, 4f));
|
||||
this.setTurretYRot(this.getTurretYRot() + Mth.clamp(0.9f * diffY, min, max));
|
||||
turretRot = Mth.clamp(0.9f * diffY, min, max);
|
||||
} else {
|
||||
turretRot = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void gunnerAngle() {
|
||||
|
|
Loading…
Add table
Reference in a new issue