diff --git a/src/main/java/com/atsuishio/superbwarfare/Mod.java b/src/main/java/com/atsuishio/superbwarfare/Mod.java index 30cbbdfcf..a9b9af560 100644 --- a/src/main/java/com/atsuishio/superbwarfare/Mod.java +++ b/src/main/java/com/atsuishio/superbwarfare/Mod.java @@ -128,6 +128,7 @@ public class Mod { MobileVehicleEntity.trackSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.TrackSound(vehicle)); MobileVehicleEntity.engineSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(vehicle)); + MobileVehicleEntity.swimSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(vehicle)); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java b/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java index 91a6867c3..a69ddcb48 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/sound/ClientSoundHandler.java @@ -25,8 +25,6 @@ public class ClientSoundHandler { // if (mobileVehicle instanceof Hpj11Entity) { // Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(mobileVehicle)); // } -// Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(mobileVehicle, mobileVehicle.getEngineSound())); -// Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(mobileVehicle)); // } // }); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java index ac406c269..83432850d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java @@ -55,6 +55,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements }; public static Consumer engineSound = vehicle -> { }; + public static Consumer swimSound = vehicle -> { + }; public static final EntityDataAccessor CANNON_RECOIL_TIME = SynchedEntityData.defineId(MobileVehicleEntity.class, EntityDataSerializers.INT); @@ -176,6 +178,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements public void baseTick() { if (!this.wasEngineRunning && this.engineRunning() && this.level().isClientSide()) { engineSound.accept(this); + swimSound.accept(this); if (this.hasTracks()) { trackSound.accept(this); } @@ -365,9 +368,9 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements Vec3 p3 = new Vec3(positionLB.x, positionLB.y, positionLB.z); Vec3 p4 = new Vec3(positionRB.x, positionRB.y, positionRB.z); - if (mainSupportingBlockPos.isPresent()) { - BlockPos blockpos = this.mainSupportingBlockPos.get(); - } +// if (mainSupportingBlockPos.isPresent()) { +// BlockPos blockpos = this.mainSupportingBlockPos.get(); +// } // 确定点位是否在墙里来调整点位高度 float p1y = (float) this.traceBlockY(p1, 3);