diff --git a/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java b/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java index cd8d0fc3b..7c177f097 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java @@ -190,17 +190,17 @@ public class DroneEntity extends PathfinderMob implements GeoEntity { if (this.getPersistentData().getBoolean("left")) { this.entityData.set(MOVEX,-1.5f); - this.entityData.set(ROTX,this.entityData.get(ROTX) + 0.13f); + this.entityData.set(ROTX,Mth.clamp(this.entityData.get(ROTX) + 0.05f, -0.5f, 0.5f)); } if (this.getPersistentData().getBoolean("right")) { this.entityData.set(MOVEX,1.5f); - this.entityData.set(ROTX,this.entityData.get(ROTX) - 0.13f); + this.entityData.set(ROTX,Mth.clamp(this.entityData.get(ROTX) - 0.05f, -0.5f, 0.5f)); } if (this.entityData.get(ROTX) > 0) { - this.entityData.set(ROTX, Mth.clamp(this.entityData.get(ROTX) - 0.55f * (float) Math.pow(this.entityData.get(ROTX),2), 0, 1f)); + this.entityData.set(ROTX, Mth.clamp(this.entityData.get(ROTX) - 0.025f, 0, 0.5f)); } else { - this.entityData.set(ROTX, Mth.clamp(this.entityData.get(ROTX) + 0.55f * (float) Math.pow(this.entityData.get(ROTX),2), -1f, 0)); + this.entityData.set(ROTX, Mth.clamp(this.entityData.get(ROTX) + 0.025f, -0.5f, 0)); } if (!this.getPersistentData().getBoolean("left") && !this.getPersistentData().getBoolean("right")) { @@ -214,17 +214,17 @@ public class DroneEntity extends PathfinderMob implements GeoEntity { if (this.getPersistentData().getBoolean("forward")) { this.entityData.set(MOVEZ,this.entityData.get(MOVEZ) - 0.15f); - this.entityData.set(ROTZ,this.entityData.get(ROTZ) - 0.13f); + this.entityData.set(ROTZ,Mth.clamp(this.entityData.get(ROTZ) - 0.05f, -0.5f, 0.5f)); } if (this.getPersistentData().getBoolean("backward")) { this.entityData.set(MOVEZ,this.entityData.get(MOVEZ) + 0.15f); - this.entityData.set(ROTZ,this.entityData.get(ROTZ) + 0.13f); + this.entityData.set(ROTZ,Mth.clamp(this.entityData.get(ROTZ) + 0.05f, -0.5f, 0.5f)); } if (this.entityData.get(ROTZ) > 0) { - this.entityData.set(ROTZ, Mth.clamp(this.entityData.get(ROTZ) - 0.55f * (float) Math.pow(this.entityData.get(ROTZ),2), 0, 1f)); + this.entityData.set(ROTZ, Mth.clamp(this.entityData.get(ROTZ) - 0.025f, 0, 0.5f)); } else { - this.entityData.set(ROTZ, Mth.clamp(this.entityData.get(ROTZ) + 0.55f * (float) Math.pow(this.entityData.get(ROTZ),2), -1f, 0)); + this.entityData.set(ROTZ, Mth.clamp(this.entityData.get(ROTZ) + 0.025f, -0.5f, 0)); } if (this.entityData.get(MOVEZ) >= 0) { diff --git a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java index de87088e8..7df6290fd 100644 --- a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java @@ -52,7 +52,7 @@ public class ClientEventHandler { data.putDouble("Cannon_xRot", Mth.clamp(0.2 * xRot, -3, 3)); data.putDouble("Cannon_yRot", Mth.clamp(1 * yRot, -15, 15)); - data.putDouble("droneCameraRotX", Mth.clamp(0.5f * xRot, -10, 10)); + data.putDouble("droneCameraRotX", Mth.clamp(0.25f * xRot, -10, 10)); data.putDouble("droneCameraRotY", Mth.clamp(0.25f * yRot, -20, 10)); } @@ -104,8 +104,8 @@ public class ClientEventHandler { data.putDouble("droneRotX", Mth.clamp(data.getDouble("droneRotX") + 0.2 * Math.pow(drone.getEntityData().get(ROTX) - data.getDouble("droneRotX"), 2),Double.NEGATIVE_INFINITY,drone.getEntityData().get(ROTX))); } - event.setPitch((float) (pitch + data.getDouble("droneCameraRotX") - 0.45f * Mth.RAD_TO_DEG * data.getDouble("droneRotZ"))); - event.setRoll((float) (roll + data.getDouble("droneCameraRotY") - 0.8f * Mth.RAD_TO_DEG * data.getDouble("droneRotX"))); + event.setPitch((float) (pitch + data.getDouble("droneCameraRotX") - 0.15f * Mth.RAD_TO_DEG * data.getDouble("droneRotZ"))); + event.setRoll((float) (roll + data.getDouble("droneCameraRotY") - 0.5f * Mth.RAD_TO_DEG * data.getDouble("droneRotX"))); }