Bug Fixes with Music playing
This commit is contained in:
@@ -27,7 +27,6 @@ public class CommandMusicMain extends Command
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
SubCommandFormattable scf = framework.run(guild, channel, user, input);
|
||||
System.out.println("SCF: " + scf.resString);
|
||||
scf.Call(res);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ public class SubCommandStop extends SubCommand
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
|
||||
return new SubCommandFormattable(guild.audio.stopPlayer(guild.audio.player));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,9 @@ public class AudioUtils
|
||||
{
|
||||
playlist.add(track);
|
||||
}
|
||||
if(!isPlaying)
|
||||
|
||||
if(player.getPlayingTrack() == null)
|
||||
{
|
||||
isPlaying = true;
|
||||
startPlay(player);
|
||||
}
|
||||
}
|
||||
@@ -118,21 +118,31 @@ public class AudioUtils
|
||||
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));
|
||||
playerManager.loadItemOrdered(player, videoURL, new SmallAudio(player));
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void startPlay(AudioPlayer player)
|
||||
{
|
||||
isPlaying = false;
|
||||
do
|
||||
{
|
||||
if(player.getPlayingTrack() == null)
|
||||
{
|
||||
player.startTrack(playlist.get(0), false);
|
||||
if(!playlist.isEmpty())
|
||||
playlist.remove(0);
|
||||
if(playlist.isEmpty())
|
||||
{
|
||||
isPlaying = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.startTrack(playlist.get(0), false);
|
||||
|
||||
if(!playlist.isEmpty())
|
||||
playlist.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
while(!playlist.isEmpty());
|
||||
while(isPlaying);
|
||||
isPlaying = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user