From e4bd8e5b00d7af0d8abc447c4be4d534e3fb6c5b Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sat, 24 May 2025 17:04:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=B7=BB=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=85=B7=E6=B6=89=E6=B0=B4=E9=9F=B3=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/atsuishio/superbwarfare/Mod.java | 1 + .../superbwarfare/client/sound/ClientSoundHandler.java | 2 -- .../entity/vehicle/base/MobileVehicleEntity.java | 9 ++++++--- 3 files changed, 7 insertions(+), 5 deletions(-) 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);