尝试添加载具涉水音效
This commit is contained in:
parent
6326c7fe99
commit
e4bd8e5b00
3 changed files with 7 additions and 5 deletions
|
@ -128,6 +128,7 @@ public class Mod {
|
||||||
|
|
||||||
MobileVehicleEntity.trackSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.TrackSound(vehicle));
|
MobileVehicleEntity.trackSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.TrackSound(vehicle));
|
||||||
MobileVehicleEntity.engineSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(vehicle));
|
MobileVehicleEntity.engineSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(vehicle));
|
||||||
|
MobileVehicleEntity.swimSound = vehicle -> Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(vehicle));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,6 @@ public class ClientSoundHandler {
|
||||||
// if (mobileVehicle instanceof Hpj11Entity) {
|
// if (mobileVehicle instanceof Hpj11Entity) {
|
||||||
// Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(mobileVehicle));
|
// 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));
|
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
|
||||||
};
|
};
|
||||||
public static Consumer<MobileVehicleEntity> engineSound = vehicle -> {
|
public static Consumer<MobileVehicleEntity> engineSound = vehicle -> {
|
||||||
};
|
};
|
||||||
|
public static Consumer<MobileVehicleEntity> swimSound = vehicle -> {
|
||||||
|
};
|
||||||
|
|
||||||
public static final EntityDataAccessor<Integer> CANNON_RECOIL_TIME = SynchedEntityData.defineId(MobileVehicleEntity.class, EntityDataSerializers.INT);
|
public static final EntityDataAccessor<Integer> CANNON_RECOIL_TIME = SynchedEntityData.defineId(MobileVehicleEntity.class, EntityDataSerializers.INT);
|
||||||
|
|
||||||
|
@ -176,6 +178,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
|
||||||
public void baseTick() {
|
public void baseTick() {
|
||||||
if (!this.wasEngineRunning && this.engineRunning() && this.level().isClientSide()) {
|
if (!this.wasEngineRunning && this.engineRunning() && this.level().isClientSide()) {
|
||||||
engineSound.accept(this);
|
engineSound.accept(this);
|
||||||
|
swimSound.accept(this);
|
||||||
if (this.hasTracks()) {
|
if (this.hasTracks()) {
|
||||||
trackSound.accept(this);
|
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 p3 = new Vec3(positionLB.x, positionLB.y, positionLB.z);
|
||||||
Vec3 p4 = new Vec3(positionRB.x, positionRB.y, positionRB.z);
|
Vec3 p4 = new Vec3(positionRB.x, positionRB.y, positionRB.z);
|
||||||
|
|
||||||
if (mainSupportingBlockPos.isPresent()) {
|
// if (mainSupportingBlockPos.isPresent()) {
|
||||||
BlockPos blockpos = this.mainSupportingBlockPos.get();
|
// BlockPos blockpos = this.mainSupportingBlockPos.get();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 确定点位是否在墙里来调整点位高度
|
// 确定点位是否在墙里来调整点位高度
|
||||||
float p1y = (float) this.traceBlockY(p1, 3);
|
float p1y = (float) this.traceBlockY(p1, 3);
|
||||||
|
|
Loading…
Add table
Reference in a new issue