Skip to content

Commit

Permalink
Fix #22 by checking master volume
Browse files Browse the repository at this point in the history
  • Loading branch information
NotRyken committed Jun 15, 2024
1 parent f140485 commit 67ed4cd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.scotsguy.nowplaying.NowPlaying;
import com.github.scotsguy.nowplaying.config.Config;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.SoundInstance;
import net.minecraft.client.sounds.SoundEventListener;
import net.minecraft.client.sounds.WeighedSoundEvents;
Expand All @@ -16,7 +17,8 @@ public void onPlaySound(@NotNull SoundInstance sound, @NotNull WeighedSoundEvent
Component name = Sound.getSoundName(sound);
NowPlaying.lastMusic = name;

if (!Config.get().options.onlyKeybind) {
if (!Config.get().options.onlyKeybind
&& Minecraft.getInstance().options.getSoundSourceVolume(SoundSource.MASTER) != 0f) {
NowPlaying.display(name);
}
}
Expand Down

0 comments on commit 67ed4cd

Please sign in to comment.