添加A10引擎音效
This commit is contained in:
parent
9659628541
commit
d6f4ff1507
9 changed files with 7247 additions and 30777 deletions
|
@ -69,6 +69,9 @@ public class A10Renderer extends GeoEntityRenderer<A10Entity> {
|
||||||
if (name.equals("gear") || name.equals("gear2") || name.equals("gear3")) {
|
if (name.equals("gear") || name.equals("gear2") || name.equals("gear3")) {
|
||||||
bone.setRotX(Mth.lerp(partialTick, animatable.gearRotO, animatable.getEntityData().get(GEAR_ROT)) * Mth.DEG_TO_RAD);
|
bone.setRotX(Mth.lerp(partialTick, animatable.gearRotO, animatable.getEntityData().get(GEAR_ROT)) * Mth.DEG_TO_RAD);
|
||||||
}
|
}
|
||||||
|
if (name.equals("qianzhou") || name.equals("qianzhou2")) {
|
||||||
|
bone.setRotZ(Mth.lerp(partialTick, animatable.propellerRotO, animatable.getPropellerRot()));
|
||||||
|
}
|
||||||
super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color);
|
super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,9 +152,6 @@ public class A10Entity extends MobileVehicleEntity implements GeoEntity {
|
||||||
@Override
|
@Override
|
||||||
public void travel() {
|
public void travel() {
|
||||||
Entity passenger = this.getFirstPassenger();
|
Entity passenger = this.getFirstPassenger();
|
||||||
|
|
||||||
// if (this.getEnergy() <= 0) return;
|
|
||||||
|
|
||||||
float diffX;
|
float diffX;
|
||||||
float diffY;
|
float diffY;
|
||||||
|
|
||||||
|
@ -170,9 +167,6 @@ public class A10Entity extends MobileVehicleEntity implements GeoEntity {
|
||||||
this.setXRot(Mth.clamp(this.getXRot() + 0.1f, -89, 89));
|
this.setXRot(Mth.clamp(this.getXRot() + 0.1f, -89, 89));
|
||||||
}
|
}
|
||||||
} else if (passenger instanceof Player player) {
|
} else if (passenger instanceof Player player) {
|
||||||
if (level().isClientSide && this.getEnergy() > 0) {
|
|
||||||
level().playLocalSound(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ(), this.getEngineSound(), this.getSoundSource(), Math.min((this.forwardInputDown ? 7.5f : 5f) * 2 * Mth.abs(this.entityData.get(POWER)), 0.25f), (random.nextFloat() * 0.1f + 1.2f), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (forwardInputDown && getEnergy() > 0) {
|
if (forwardInputDown && getEnergy() > 0) {
|
||||||
this.consumeEnergy(VehicleConfig.TOM_6_ENERGY_COST.get());
|
this.consumeEnergy(VehicleConfig.TOM_6_ENERGY_COST.get());
|
||||||
|
@ -221,6 +215,8 @@ public class A10Entity extends MobileVehicleEntity implements GeoEntity {
|
||||||
|
|
||||||
setFlap3Rot(diffY * 0.7f);
|
setFlap3Rot(diffY * 0.7f);
|
||||||
|
|
||||||
|
this.setPropellerRot(this.getPropellerRot() + 30 * this.entityData.get(POWER));
|
||||||
|
|
||||||
if (!onGround() && getDeltaMovement().dot(getViewVector(1)) * 72 > 150) {
|
if (!onGround() && getDeltaMovement().dot(getViewVector(1)) * 72 > 150) {
|
||||||
flyTime = Math.min(flyTime + 1, 20);
|
flyTime = Math.min(flyTime + 1, 20);
|
||||||
}
|
}
|
||||||
|
@ -311,7 +307,7 @@ public class A10Entity extends MobileVehicleEntity implements GeoEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SoundEvent getEngineSound() {
|
public SoundEvent getEngineSound() {
|
||||||
return ModSounds.WHEEL_CHAIR_ENGINE.get();
|
return ModSounds.A_10_ENGINE.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void clampRotation(Entity entity) {
|
protected void clampRotation(Entity entity) {
|
||||||
|
|
|
@ -97,6 +97,14 @@ public class ClientSoundHandler {
|
||||||
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), e.onGround() ? 0 : distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.002f + 1.05), false);
|
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), e.onGround() ? 0 : distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.002f + 1.05), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (e instanceof A10Entity a10Entity) {
|
||||||
|
distanceReduce = (float) Math.max((1 - distance / 128), 0);
|
||||||
|
if (player.getVehicle() == a10Entity) {
|
||||||
|
player.playSound(ModSounds.A_10_ENGINE_1P.get(), 2 * (mobileVehicle.getEntityData().get(POWER) - 0.012f), (float) ((2 * Math.random() - 1) * 0.1f + 1.0f));
|
||||||
|
} else {
|
||||||
|
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), 5 * (mobileVehicle.getEntityData().get(POWER) - 0.012f) * distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.1f + 1), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -440,5 +440,9 @@ public class ModSounds {
|
||||||
public static final DeferredHolder<SoundEvent, SoundEvent> INSIDIOUS_RELOAD_EMPTY = REGISTRY.register("insidious_reload_empty", () -> SoundEvent.createVariableRangeEvent(Mod.loc("insidious_reload_empty")));
|
public static final DeferredHolder<SoundEvent, SoundEvent> INSIDIOUS_RELOAD_EMPTY = REGISTRY.register("insidious_reload_empty", () -> SoundEvent.createVariableRangeEvent(Mod.loc("insidious_reload_empty")));
|
||||||
public static final DeferredHolder<SoundEvent, SoundEvent> SMOKE_FIRE = REGISTRY.register("smoke_fire", () -> SoundEvent.createVariableRangeEvent(Mod.loc("smoke_fire")));
|
public static final DeferredHolder<SoundEvent, SoundEvent> SMOKE_FIRE = REGISTRY.register("smoke_fire", () -> SoundEvent.createVariableRangeEvent(Mod.loc("smoke_fire")));
|
||||||
public static final DeferredHolder<SoundEvent, SoundEvent> HPJ_11_FIRE_3P = REGISTRY.register("hpj_11_fire_3p", () -> SoundEvent.createVariableRangeEvent(Mod.loc("hpj_11_fire_3p")));
|
public static final DeferredHolder<SoundEvent, SoundEvent> HPJ_11_FIRE_3P = REGISTRY.register("hpj_11_fire_3p", () -> SoundEvent.createVariableRangeEvent(Mod.loc("hpj_11_fire_3p")));
|
||||||
|
public static final DeferredHolder<SoundEvent, SoundEvent> HPJ_11_FAR = REGISTRY.register("hpj_11_far", () -> SoundEvent.createVariableRangeEvent(Mod.loc("hpj_11_far")));
|
||||||
|
public static final DeferredHolder<SoundEvent, SoundEvent> HPJ_11_VERYFAR = REGISTRY.register("hpj_11_veryfar", () -> SoundEvent.createVariableRangeEvent(Mod.loc("hpj_11_veryfar")));
|
||||||
|
public static final DeferredHolder<SoundEvent, SoundEvent> A_10_ENGINE = REGISTRY.register("a10_engine", () -> SoundEvent.createVariableRangeEvent(Mod.loc("a10_engine")));
|
||||||
|
public static final DeferredHolder<SoundEvent, SoundEvent> A_10_ENGINE_1P = REGISTRY.register("a10_engine_1p", () -> SoundEvent.createVariableRangeEvent(Mod.loc("a10_engine_1p")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3051,5 +3051,35 @@
|
||||||
"stream": false
|
"stream": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"hpj_11_far": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:hpj11/hpj_11_far",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hpj_11_veryfar": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:hpj11/hpj_11_veryfar",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"a10_engine": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:a10/a10_engine"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"a10_engine_1p": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:a10/a10_engine_1p"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 93 KiB |
Loading…
Add table
Reference in a new issue