Skip to content

Commit

Permalink
Null check mc in onLoadSound
Browse files Browse the repository at this point in the history
Signed-off-by: djpadbit <[email protected]>
  • Loading branch information
djpadbit committed Sep 4, 2020
1 parent 87ced9e commit d0bb85f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public static void onPlaySound(final float posX, final float posY, final float p
*/
public static SoundBuffer onLoadSound(SoundBuffer buff, String filename) {
if (buff == null || buff.audioFormat.getChannels() == 1 || !Config.autoSteroDownmix) return buff;
if (mc.player == null || mc.world == null || lastSoundCategory == SoundCategory.RECORDS || lastSoundCategory == SoundCategory.MUSIC ||
if (mc == null || mc.player == null || mc.world == null || lastSoundCategory == SoundCategory.RECORDS || lastSoundCategory == SoundCategory.MUSIC ||
uiPattern.matcher(filename).matches() || clickPattern.matcher(filename).matches() || betweenlandsPattern.matcher(filename).matches() ||
travelPattern.matcher(filename).matches()) {
if (Config.autoSteroDownmixLogging) log("Not converting sound '"+filename+"'("+buff.audioFormat.toString()+")");
Expand Down

0 comments on commit d0bb85f

Please sign in to comment.