Search in sources :

Example 1 with RadioUtils.getListenedRadio

use of gg.projecteden.nexus.features.radio.RadioUtils.getListenedRadio in project Nexus by ProjectEdenGG.

the class RadioCommand method songInfo.

@Path("info")
@Description("Shows info about the radio you are listening to")
void songInfo() {
    Radio radio = RadioUtils.getListenedRadio(player(), true);
    if (radio == null)
        error("You are not listening to a radio!");
    SongPlayer songPlayer = radio.getSongPlayer();
    Song song = songPlayer.getSong();
    send(PREFIX + "Radio Info:");
    send("&3Radio: &e" + StringUtils.camelCase(radio.getId()));
    List<String> list = RadioUtils.getPlaylistHover(radio);
    send(json("&3Songs: &e[" + list.size() + "]").hover(list).loreize(false));
    send("&3Playing: &e" + song.getTitle() + " &3by &e" + song.getAuthor() + " &3(" + getSongPercent(songPlayer) + "%)");
    line();
}
Also used : RadioSong(gg.projecteden.nexus.models.radio.RadioConfig.RadioSong) Song(com.xxmicloxx.NoteBlockAPI.model.Song) SongPlayer(com.xxmicloxx.NoteBlockAPI.songplayer.SongPlayer) Radio(gg.projecteden.nexus.models.radio.RadioConfig.Radio) RadioUtils.getListenedRadio(gg.projecteden.nexus.features.radio.RadioUtils.getListenedRadio) RadioUtils.isInRangeOfRadiusRadio(gg.projecteden.nexus.features.radio.RadioUtils.isInRangeOfRadiusRadio) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Aggregations

Song (com.xxmicloxx.NoteBlockAPI.model.Song)1 SongPlayer (com.xxmicloxx.NoteBlockAPI.songplayer.SongPlayer)1 RadioUtils.getListenedRadio (gg.projecteden.nexus.features.radio.RadioUtils.getListenedRadio)1 RadioUtils.isInRangeOfRadiusRadio (gg.projecteden.nexus.features.radio.RadioUtils.isInRangeOfRadiusRadio)1 Description (gg.projecteden.nexus.framework.commands.models.annotations.Description)1 Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)1 Radio (gg.projecteden.nexus.models.radio.RadioConfig.Radio)1 RadioSong (gg.projecteden.nexus.models.radio.RadioConfig.RadioSong)1