修复加特林右键开火bug

This commit is contained in:
Atsuishio 2025-04-14 03:01:15 +08:00 committed by Light_Quanta
parent 7d36f3b7ca
commit 75e6476056
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -264,14 +264,14 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
this.level().addFreshEntity(flareDecoyEntity); this.level().addFreshEntity(flareDecoyEntity);
} }
this.level().playSound(null, this, ModSounds.DECOY_FIRE.get(), this.getSoundSource(), 1, 1); this.level().playSound(null, this, ModSounds.DECOY_FIRE.get(), this.getSoundSource(), 1, 1);
if (this.getEntityData().get(DECOY_COUNT) == 3) { if (this.getEntityData().get(DECOY_COUNT) == 4) {
decoyReloadCoolDown = 300; decoyReloadCoolDown = 300;
} }
this.getEntityData().set(DECOY_COUNT, this.getEntityData().get(DECOY_COUNT) - 1); this.getEntityData().set(DECOY_COUNT, this.getEntityData().get(DECOY_COUNT) - 1);
} }
decoyInputDown = false; decoyInputDown = false;
} }
if (this.entityData.get(DECOY_COUNT) < 3 && decoyReloadCoolDown == 0 && this.level() instanceof ServerLevel) { if (this.entityData.get(DECOY_COUNT) < 4 && decoyReloadCoolDown == 0 && this.level() instanceof ServerLevel) {
this.entityData.set(DECOY_COUNT, this.entityData.get(DECOY_COUNT) + 1); this.entityData.set(DECOY_COUNT, this.entityData.get(DECOY_COUNT) + 1);
this.level().playSound(null, this, ModSounds.DECOY_RELOAD.get(), this.getSoundSource(), 1, 1); this.level().playSound(null, this, ModSounds.DECOY_RELOAD.get(), this.getSoundSource(), 1, 1);
decoyReloadCoolDown = 300; decoyReloadCoolDown = 300;