Skip to content

Commit

Permalink
Only show ingame music when music is actually playing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixklauke committed Mar 30, 2020
1 parent cb6c4a9 commit 146c561
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ private StreamModule(MusicPlayer musicPlayer) {
this.musicPlayer = musicPlayer;
}

@Override
public boolean isShown() {
return musicPlayer.currentStream().isPresent()
&& musicPlayer.isPlaying()
&& super.isShown();
}

@Override
public IconData getIconData() {
return new IconData(Material.NOTE_BLOCK);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ilovemusic.labymod;

import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.labymod.ingamegui.ModuleCategory;
Expand All @@ -27,7 +25,9 @@ private StreamModule(

@Override
public boolean isShown() {
return musicPlayer.currentStream().isPresent() && super.isShown();
return musicPlayer.currentStream().isPresent()
&& musicPlayer.isPlaying()
&& super.isShown();
}

@Override
Expand Down

0 comments on commit 146c561

Please sign in to comment.