This commit is contained in:
Coloryr committed 2020-02-21 15:46:03 +08:00
1 parent 92a4bbf387
commit 8a627d755f
5 files changed
+18 -18

No files matched your search

@@ -4,7 +4,6 @@ import Color_yr.ALLMusic.ALLMusic;
import Color_yr.ALLMusic.ALLMusicBC;
import Color_yr.ALLMusic.Play.PlayMusic;
import Color_yr.ALLMusic.Utils.Function;
import Color_yr.ALLMusic.Utils.logs;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
@@ -41,10 +40,9 @@ public class CommandBC extends Command implements TabExecutor {
return;
} else if (ALLMusic.Config.getBanMusic().contains(MusicID)) {
sender.sendMessage(new TextComponent("§d[ALLMusic]§c错误,这首歌被禁点了"));
} else if (PlayMusic.PlayList.contains(MusicID)) {
sender.sendMessage(new TextComponent("§d[ALLMusic]§c错误,这首歌已经在队列了"));
} else {
PlayMusic.AddMusic(MusicID, sender.getName());
sender.sendMessage(new TextComponent("§d[ALLMusic]§2点歌成功"));
}
ALLMusic.Config.RemoveNoMusicPlayer(sender.getName());
} else
@@ -75,7 +73,7 @@ public class CommandBC extends Command implements TabExecutor {
sender.sendMessage(new TextComponent("§d[ALLMusic]§2队列中无歌曲"));
} else {
sender.sendMessage(new TextComponent("§d[ALLMusic]§2队列中有歌曲数:" + PlayMusic.PlayList.size()));
sender.sendMessage(new TextComponent("§d[ALLMusic]§2当前队列\n" + PlayMusic.getList()));
sender.sendMessage(new TextComponent(PlayMusic.getList()));
}
} else if (args[0].equalsIgnoreCase("vote")) {
if (PlayMusic.PlayList.size() == 0) {
@@ -89,6 +87,7 @@ public class CommandBC extends Command implements TabExecutor {
} else if (PlayMusic.Vote_time > 0) {
if (!PlayMusic.Vote.contains(name)) {
PlayMusic.Vote.add(name);
sender.sendMessage(new TextComponent("§d[ALLMusic]§2你已同意"));
ProxyServer.getInstance().broadcast(new TextComponent("§d[ALLMusic]§2" + name + "同意切歌,共有" +
PlayMusic.Vote.size() + "名玩家同意切歌。"));
} else {
@@ -123,11 +122,11 @@ public class CommandBC extends Command implements TabExecutor {
} else if (args[0].equalsIgnoreCase("delete") && args.length == 2
&& ALLMusic.Config.getAdmin().contains(name)) {
if (Function.isInteger(args[1])) {
String music = args[1];
PlayMusic.PlayList.removeIf(info -> info.getID().equalsIgnoreCase(music));
sender.sendMessage(new TextComponent("§d[ALLMusic]§2已删除" + music));
int music = Integer.parseInt(args[1]);
PlayMusic.PlayList.remove(music);
sender.sendMessage(new TextComponent("§d[ALLMusic]§2已删除序列" + music));
} else {
sender.sendMessage(new TextComponent("§d[ALLMusic]§2请输入有效的ID"));
sender.sendMessage(new TextComponent("§d[ALLMusic]§2请输入有效的序列ID"));
}
} else
AddMusic(sender, args);
@@ -3,9 +3,7 @@ package Color_yr.ALLMusic.Command;
import Color_yr.ALLMusic.ALLMusic;
import Color_yr.ALLMusic.ALLMusicBC;
import Color_yr.ALLMusic.Play.PlayMusic;
import Color_yr.ALLMusic.Song.Info;
import Color_yr.ALLMusic.Utils.Function;
import Color_yr.ALLMusic.Utils.logs;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -38,10 +36,9 @@ public class CommandBukkit implements CommandExecutor, TabExecutor {
return;
} else if (ALLMusic.Config.getBanMusic().contains(MusicID)) {
sender.sendMessage("§d[ALLMusic]§c错误,这首歌被禁点了");
} else if (PlayMusic.PlayList.contains(MusicID)) {
sender.sendMessage("§d[ALLMusic]§c错误,这首歌已经在队列了");
} else {
PlayMusic.AddMusic(MusicID, sender.getName());
sender.sendMessage("§d[ALLMusic]§2点歌成功");
}
ALLMusic.Config.RemoveNoMusicPlayer(sender.getName());
} else
@@ -74,7 +71,7 @@ public class CommandBukkit implements CommandExecutor, TabExecutor {
sender.sendMessage("§d[ALLMusic]§2队列中无歌曲");
} else {
sender.sendMessage("§d[ALLMusic]§2队列中有歌曲数:" + PlayMusic.PlayList.size());
sender.sendMessage("§d[ALLMusic]§2当前队列\n" + PlayMusic.getList());
sender.sendMessage(PlayMusic.getList());
}
} else if (args[0].equalsIgnoreCase("vote")) {
if (PlayMusic.PlayList.size() == 0) {
@@ -88,6 +85,7 @@ public class CommandBukkit implements CommandExecutor, TabExecutor {
} else if (PlayMusic.Vote_time > 0) {
if (!PlayMusic.Vote.contains(name)) {
PlayMusic.Vote.add(name);
sender.sendMessage("§d[ALLMusic]§2你已同意");
Bukkit.broadcastMessage("§d[ALLMusic]§2" + name + "同意切歌,共有" +
PlayMusic.Vote.size() + "名玩家同意切歌。");
} else {
@@ -122,11 +120,11 @@ public class CommandBukkit implements CommandExecutor, TabExecutor {
} else if (args[0].equalsIgnoreCase("delete") && args.length == 2
&& ALLMusic.Config.getAdmin().contains(name)) {
if (Function.isInteger(args[1])) {
String music = args[1];
PlayMusic.PlayList.removeIf(info -> info.getID().equalsIgnoreCase(music));
sender.sendMessage("§d[ALLMusic]§2已删除" + music);
int music = Integer.parseInt(args[1]);
PlayMusic.PlayList.remove(music);
sender.sendMessage("§d[ALLMusic]§2已删除序列" + music);
} else {
sender.sendMessage("§d[ALLMusic]§2请输入有效的ID");
sender.sendMessage("§d[ALLMusic]§2请输入有效的序列ID");
}
} else
AddMusic(sender, args);
@@ -46,6 +46,8 @@ public class LyricDo {
continue;
if (!Function.isInteger(sec))
continue;
if(min.isEmpty() || sec.isEmpty())
continue;
time = Integer.parseInt(min) * 60 + Integer.parseInt(sec);
if (time > 0)
time -= ALLMusic.Config.getDelay();
@@ -20,7 +20,7 @@ class lrc {
private String lyric;
public String getLyric() {
return lyric;
return lyric == null ? "" : lyric;
}
}
class tlyric {
@@ -57,6 +57,7 @@ class PlayGo extends Thread {
if (PlayMusic.Vote.size() >= ALLMusic.Config.getMinVote() || (players <= ALLMusic.Config.getMinVote() && players == PlayMusic.Vote.size())) {
ProxyServer.getInstance().broadcast(new TextComponent("§d[ALLMusic]§2" + "已切歌"));
ALLMusic.Side.Send("[Stop]", false);
PlayMusic.Vote.clear();
PlayMusic.MusicAllTime = 1;
if (PlayMusic.PlayList.size() == 0) {
ProxyServer.getInstance().broadcast(new TextComponent("§d[ALLMusic]§2" + "队列中无歌曲"));