diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index 19ce848f8..b2d4a8213 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -208,8 +208,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { this.entityData.set(POWER, this.entityData.get(POWER) * 0.995f); this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) * 0.95f); - - this.setDeltaMovement(this.getDeltaMovement().add(getViewVector(1).scale(0.03 * this.entityData.get(POWER)))); + this.setDeltaMovement(this.getDeltaMovement().add(getViewVector(1).scale(0.04 * this.entityData.get(POWER)))); setDeltaMovement(getDeltaMovement().add(0.0f, Mth.clamp(Math.sin((onGround() ? 45 : -(getXRot() - 20)) * Mth.DEG_TO_RAD) * Math.sin((90 - this.getXRot()) * Mth.DEG_TO_RAD) * getDeltaMovement().dot(getViewVector(1)) * 0.04, -0.04, 0.09), 0.0f)); @@ -223,14 +222,19 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { // )); } + @Override + public boolean engineRunning() { + return (getFirstPassenger() != null && Math.abs(getDeltaMovement().length()) > 0); + } + @Override public SoundEvent getEngineSound() { - return super.getEngineSound(); + return ModSounds.FLY_LOOP.get(); } @Override public float getEngineSoundVolume() { - return entityData.get(POWER); + return (float) getDeltaMovement().length(); } protected void clampRotation(Entity entity) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java index 76533a35b..b1f5017e1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java @@ -162,7 +162,7 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { } if (this.forwardInputDown) { - this.entityData.set(POWER, this.entityData.get(POWER) + 0.01f); + this.entityData.set(POWER, this.entityData.get(POWER) + (sprintInputDown ? 0.02f : 0.01f)); if (this.getEnergy() <= 0 && passenger instanceof Player player) { moveWithOutPower(player, true); } @@ -225,7 +225,7 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { @Override public float getEngineSoundVolume() { - return entityData.get(POWER); + return getEnergy() > 0 ? entityData.get(POWER) : 0; } protected void clampRotation(Entity entity) { diff --git a/src/main/java/com/atsuishio/superbwarfare/init/ModSounds.java b/src/main/java/com/atsuishio/superbwarfare/init/ModSounds.java index 4e116d9ca..7ba338d55 100644 --- a/src/main/java/com/atsuishio/superbwarfare/init/ModSounds.java +++ b/src/main/java/com/atsuishio/superbwarfare/init/ModSounds.java @@ -464,6 +464,7 @@ public class ModSounds { public static final DeferredHolder MISSILE_START = REGISTRY.register("missile_start", () -> SoundEvent.createVariableRangeEvent(Mod.loc("missile_start"))); public static final DeferredHolder JET_LOCK = REGISTRY.register("jet_lock", () -> SoundEvent.createVariableRangeEvent(Mod.loc("jet_lock"))); public static final DeferredHolder JET_LOCKON = REGISTRY.register("jet_lockon", () -> SoundEvent.createVariableRangeEvent(Mod.loc("jet_lockon"))); + public static final DeferredHolder FLY_LOOP = REGISTRY.register("fly_loop", () -> SoundEvent.createVariableRangeEvent(Mod.loc("fly_loop"))); public static final DeferredHolder AURELIA_SCEPTRE_FIRE_1P = REGISTRY.register("aurelia_sceptre_fire_1p", () -> SoundEvent.createVariableRangeEvent(Mod.loc("aurelia_sceptre_fire_1p"))); public static final DeferredHolder AURELIA_SCEPTRE_FIRE_3P = REGISTRY.register("aurelia_sceptre_fire_3p", () -> SoundEvent.createVariableRangeEvent(Mod.loc("aurelia_sceptre_fire_3p"))); diff --git a/src/main/resources/assets/superbwarfare/sounds.json b/src/main/resources/assets/superbwarfare/sounds.json index bb4579732..a29a73842 100644 --- a/src/main/resources/assets/superbwarfare/sounds.json +++ b/src/main/resources/assets/superbwarfare/sounds.json @@ -3218,5 +3218,13 @@ "stream": false } ] + }, + "fly_loop": { + "sounds": [ + { + "name": "superbwarfare:fly_loop", + "stream": false + } + ] } } \ No newline at end of file diff --git a/src/main/resources/assets/superbwarfare/sounds/fly_loop.ogg b/src/main/resources/assets/superbwarfare/sounds/fly_loop.ogg new file mode 100644 index 000000000..8cec57cac Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/fly_loop.ogg differ diff --git a/src/main/resources/assets/superbwarfare/sounds/wheel_chair/wheel_chair_engine.ogg b/src/main/resources/assets/superbwarfare/sounds/wheel_chair/wheel_chair_engine.ogg index ae78c8988..7a3e4ddcd 100644 Binary files a/src/main/resources/assets/superbwarfare/sounds/wheel_chair/wheel_chair_engine.ogg and b/src/main/resources/assets/superbwarfare/sounds/wheel_chair/wheel_chair_engine.ogg differ