use of xyz.derkades.ublisk.ext.com.xxmicloxx.noteblockapi.SongPlayer in project Ublisk by Derkades.
the class SongEnd method musicStopped.
@EventHandler
public void musicStopped(SongEndEvent event) {
try {
SongPlayer songPlayer = event.getSongPlayer();
for (String playername : songPlayer.getPlayerList()) {
UPlayer player = new UPlayer(playername);
if (player.getSetting(Setting.PLAY_MUSIC)) {
Town town = player.getTown();
if (town != null) {
town.playThemeToPlayer(player);
}
}
}
songPlayer.destroy();
} catch (PlayerNotFoundException e) {
Logger.log(LogLevel.WARNING, "Music", "Tried to play new song but player has already logged out");
}
}
Aggregations