forked from chipmunkmc/chipmunkbot
fi
This commit is contained in:
parent
11ed0c5eb1
commit
8d81084f8d
1 changed files with 9 additions and 4 deletions
|
@ -13,6 +13,7 @@ import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.JoinConfiguration;
|
import net.kyori.adventure.text.JoinConfiguration;
|
||||||
import net.kyori.adventure.text.event.ClickEvent;
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
import net.kyori.adventure.text.event.HoverEvent;
|
import net.kyori.adventure.text.event.HoverEvent;
|
||||||
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -92,13 +93,17 @@ public class MusicCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int play (CommandContext<CommandSource> context) {
|
public int play (CommandContext<CommandSource> context) {
|
||||||
final SongPlayer songPlayer = context.getSource().client().songPlayer();
|
final CommandSource source = context.getSource();
|
||||||
|
|
||||||
|
final SongPlayer songPlayer = source.client().songPlayer();
|
||||||
|
|
||||||
final Path path = getPath(context, "location");
|
final Path path = getPath(context, "location");
|
||||||
|
|
||||||
songPlayer.loadSong(path);
|
if (path != null) songPlayer.loadSong(path);
|
||||||
// if (path != null) songPlayer.loadSong(path);
|
else {
|
||||||
// else songPlayer.loadSong(getUrl(context, "location"));
|
source.sendOutput(Component.text("no").color(NamedTextColor.RED));
|
||||||
|
// songPlayer.loadSong(getUrl(context, "location"));
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue