Skip to content

Commit

Permalink
Fixes (#38) null sound event crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrenix committed Jun 12, 2023
1 parent d98b853 commit 2e0e9b9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ public abstract class ClientLevelMixin
)
private void NT$onPlayPositionedSound(Player player, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, CallbackInfo callback)
{
// This shouldn't be null, but returning here prevents crash reports that point to this mod to being at fault
if (sound == null)
return;

/* Attack Sounds */

boolean isAttack = sound == SoundEvents.PLAYER_ATTACK_KNOCKBACK ||
Expand Down

0 comments on commit 2e0e9b9

Please sign in to comment.