diff --git a/src/main/java/com/hbm/handler/GunConfiguration.java b/src/main/java/com/hbm/handler/GunConfiguration.java index 470883534..591d19e3d 100644 --- a/src/main/java/com/hbm/handler/GunConfiguration.java +++ b/src/main/java/com/hbm/handler/GunConfiguration.java @@ -63,6 +63,7 @@ public class GunConfiguration implements Cloneable { public int emptyReloadAdditionalDuration; //sound path to the reload sound public String reloadSound = ""; + public String reloadSoundEmpty = null; //whether the reload sound should be played at the beginning or at the end of the reload public boolean reloadSoundEnd = true; public String equipSound = ""; @@ -114,6 +115,7 @@ public class GunConfiguration implements Cloneable { public static final String RSOUND_REVOLVER = "hbm:weapon.revolverReload"; public static final String RSOUND_RIFLE = ""; public static final String RSOUND_MAG = "hbm:weapon.magReload"; + public static final String RSOUND_MAG_BOLT = "hbm:weapon.magReloadBolt"; public static final String RSOUND_SHOTGUN = "hbm:weapon.shotgunReload"; public static final String RSOUND_LAUNCHER = "hbm:weapon.rpgReload"; public static final String RSOUND_GRENADE = "hbm:weapon.hkReload"; diff --git a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java index 3ebb558e5..0bb1f6103 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java @@ -246,6 +246,7 @@ public class Gun12GaugeFactory { config.reloadDuration = 21; config.emptyReloadAdditionalDuration = 15; config.reloadSound = GunConfiguration.RSOUND_MAG; + config.reloadSoundEmpty = GunConfiguration.RSOUND_MAG_BOLT; config.reloadSoundEnd = false; config.name += "Drum"; diff --git a/src/main/java/com/hbm/items/weapon/ItemGunBase.java b/src/main/java/com/hbm/items/weapon/ItemGunBase.java index 4edb48d46..c506eee78 100644 --- a/src/main/java/com/hbm/items/weapon/ItemGunBase.java +++ b/src/main/java/com/hbm/items/weapon/ItemGunBase.java @@ -364,6 +364,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu setIsReloading(stack, false); return; } + + String reloadSound = mainConfig.reloadSoundEmpty != null && getMag(stack) == 0 ? mainConfig.reloadSoundEmpty : mainConfig.reloadSound; ammo.stacksize = toConsume; setMag(stack, getMag(stack) + toAdd); @@ -375,11 +377,11 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu AnimType animType = availableFills <= 1 ? AnimType.RELOAD_END : AnimType.RELOAD_CYCLE; PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(animType.ordinal()), (EntityPlayerMP) player); if (availableFills > 1 && !mainConfig.reloadSoundEnd) - world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F); + world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F); } if(hasLoaded && mainConfig.reloadSoundEnd) - world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F); + world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F); if(mainConfig.ejector != null && mainConfig.ejector.getAfterReload()) queueCasing(player, mainConfig.ejector, prevCfg, stack); @@ -418,8 +420,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu if(getIsReloading(stack)) return; - if(!mainConfig.reloadSoundEnd) - world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F); + if(!mainConfig.reloadSoundEnd) { + String reloadSound = mainConfig.reloadSoundEmpty != null && getMag(stack) == 0 ? mainConfig.reloadSoundEmpty : mainConfig.reloadSound; + world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F); + } if(!world.isRemote) { AnimType reloadType = getMag(stack) == 0 ? AnimType.RELOAD_EMPTY : AnimType.RELOAD; diff --git a/src/main/resources/assets/hbm/sounds.json b/src/main/resources/assets/hbm/sounds.json index c50ce0410..56d368ce8 100644 --- a/src/main/resources/assets/hbm/sounds.json +++ b/src/main/resources/assets/hbm/sounds.json @@ -171,6 +171,7 @@ "weapon.revolverReload": {"category": "player", "sounds": [{"name": "weapon/revolverReload", "stream": false}]}, "weapon.shotgunReload": {"category": "player", "sounds": ["weapon/shotgunReload1", "weapon/shotgunReload2", "weapon/shotgunReload3"]}, "weapon.magReload": {"category": "player", "sounds": [{"name": "weapon/magReload", "stream": false}]}, + "weapon.magReloadBolt": {"category": "player", "sounds": [{"name": "weapon/magReloadBolt", "stream": false}]}, "weapon.rpgReload": {"category": "player", "sounds": [{"name": "weapon/rpgReload", "stream": false}]}, "weapon.boat": {"category": "player", "sounds": [{"name": "weapon/boat", "stream": false}]}, "weapon.hkShoot": {"category": "player", "sounds": [{"name": "weapon/hkShoot", "stream": false}]}, diff --git a/src/main/resources/assets/hbm/sounds/weapon/magReloadBolt.ogg b/src/main/resources/assets/hbm/sounds/weapon/magReloadBolt.ogg new file mode 100644 index 000000000..0e8c4794a Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/magReloadBolt.ogg differ