Skip to content

Commit

Permalink
Fix issue with standart discs
Browse files Browse the repository at this point in the history
  • Loading branch information
sub-kek committed Aug 26, 2024
1 parent 2631908 commit f7a201e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onEnable() {
}

getServer().getPluginManager().registerEvents(new JukeboxHandler(), this);
getServer().getPluginManager().registerEvents(HopperHandler.instance(), this);
getServer().getPluginManager().registerEvents(HopperHandler.getInstance(), this);

CustomDiscsCommand customDiscsCommand = new CustomDiscsCommand();
getCommand("customdisc").setExecutor(customDiscsCommand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void stopPlaying(UUID uuid, boolean includeBlock) {
lavaPlayer.audioPlayer.destroy();
lavaPlayer.lavaPlayerThread.interrupt();
if (includeBlock) {
HopperHandler.instance().discToHopper(lavaPlayer.block);
HopperHandler.getInstance().discToHopper(lavaPlayer.block);
}
} else {
CustomDiscs.debug(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/github/subkek/customdiscs/PlayerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public void playLocationalAudio(VoicechatServerApi api, Path soundFilePath, Bloc
return;
}

audioPlayer.setOnStopped(() -> HopperHandler.instance().discToHopper(block));

synchronized (stopped) {
if (!stopped.get()) {
player.set(audioPlayer);
} else {
audioPlayer.stopPlaying();
stopPlaying(id);
HopperHandler.getInstance().discToHopper(block);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class HopperHandler implements Listener {
PlayerManager playerManager = PlayerManager.getInstance();
LavaPlayerManager lavaPlayerManager = LavaPlayerManager.getInstance();

public static HopperHandler instance() {
public static HopperHandler getInstance() {
if (instance == null) {
instance = new HopperHandler();
}
Expand Down

0 comments on commit f7a201e

Please sign in to comment.