Skip to content

Commit 9c2bf15

Browse files
committed
Made out of ammo sound public
Closes #705
1 parent bd370c6 commit 9c2bf15

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/me/zombie_striker/qg/guns/Gun.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,11 @@ private boolean onClick(final Player player, ItemStack usedItem, boolean fire) {
912912
if (GunUtil.rapidfireshooters.containsKey(player.getUniqueId()))
913913
GunUtil.rapidfireshooters.remove(player.getUniqueId()).cancel();
914914

915-
player.playSound(player.getLocation(), WeaponSounds.OUT_OF_AMMO_CLICK.getSoundName(), 1f, 1f);
915+
try {
916+
player.getWorld().playSound(player.getLocation(), WeaponSounds.OUT_OF_AMMO_CLICK.getSoundName(), 1f, 1f);
917+
} catch (Exception | Error ignored) {
918+
player.playSound(player.getLocation(), WeaponSounds.OUT_OF_AMMO_CLICK.getSoundName(), 1f, 1f);
919+
}
916920

917921
if (QAMain.enableReloadWhenOutOfAmmo) {
918922
if (offhand) {

src/main/resources/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.1.1
2+
- 1.21.11 support
3+
- Made out of ammo sound public
4+
- Fixed direct entities hit
5+
16
2.1.0
27
- 1.21.10 support
38
- Added new fully customizable menu

0 commit comments

Comments
 (0)