mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-22 22:29:44 +00:00
up
This commit is contained in:
1 parent
8d4bccd711
commit
f468220e82
12 files changed
+130
-99
No files matched your search
@@ -267,6 +267,7 @@ public class CommandEX {
|
||||
this.add("addlist");
|
||||
this.add("clearlist");
|
||||
this.add("login");
|
||||
this.add("code");
|
||||
}};
|
||||
|
||||
/**
|
||||
|
||||
@@ -206,8 +206,8 @@ public class ConfigObj {
|
||||
minVote = 3;
|
||||
voteTime = 30;
|
||||
adminList = new HashSet<>();
|
||||
adminList.add("CONSOLE");
|
||||
adminList.add("Color_yr");
|
||||
adminList.add("console");
|
||||
adminList.add("color_yr");
|
||||
muteServer = new HashSet<>();
|
||||
mutePlayer = new HashSet<>();
|
||||
banMusic = new HashSet<>();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SaveObj {
|
||||
list = new PosObj(2, 74, HudDirType.TOP_LEFT, 0xffffff, false, true);
|
||||
lyric = new PosObj(74, 53, HudDirType.TOP_LEFT, 0xffffff, false, true);
|
||||
info = new PosObj(74, 2, HudDirType.TOP_LEFT, 0xffffff, false, true);
|
||||
pic = new PosObj(2, 2, HudDirType.TOP_LEFT, 0, false, true);
|
||||
pic = new PosObj(2, 2, HudDirType.TOP_LEFT, 70, false, true);
|
||||
}
|
||||
|
||||
public static SaveObj make() {
|
||||
|
||||
+59
-28
@@ -125,17 +125,32 @@ public class DataSql {
|
||||
init();
|
||||
}
|
||||
Statement stat = connection.createStatement();
|
||||
sql = MessageFormat.format("UPDATE allmusic SET info_x={0},info_y={1},info_color={15},info_dir={16},info_shadow={17},info_enable={2},lyric_x={3},lyric_y={4},lyric_color={18},lyric_dir={19},lyric_shadow={20},lyric_enable={5},list_x={6},list_y={7}, list_color={21},list_dir={22},list_shadow={23},list_enable={8},pic_x={9},pic_y={10},pic_dir={24},pic_enable={11},pic_size={12},pic_rotate={13},pic_rotate_speed={14} WHERE name=@name",
|
||||
hud.info.x, hud.info.y, hud.info.enable ? 1 : 0,
|
||||
hud.lyric.x, hud.lyric.y, hud.lyric.enable ? 1 : 0,
|
||||
hud.list.x, hud.list.y, hud.list.enable ? 1 : 0,
|
||||
hud.pic.x, hud.pic.y, hud.pic.enable ? 1 : 0,
|
||||
hud.pic.color, hud.pic.shadow ? 1 : 0,
|
||||
hud.picRotateSpeed, hud.info.color, hud.info.dir.ordinal(),
|
||||
hud.info.shadow ? 1 : 0, hud.lyric.color, hud.lyric.dir.ordinal(),
|
||||
hud.lyric.shadow ? 1 : 0, hud.list.color, hud.list.dir.ordinal(),
|
||||
hud.list.shadow ? 1 : 0, hud.pic.dir.ordinal());
|
||||
sql = sql.replace("@name", "'" + name + "'");
|
||||
sql = "UPDATE allmusic SET " +
|
||||
"info_x=" + hud.info.x + "," +
|
||||
"info_y=" + hud.info.y + "," +
|
||||
"info_color=" + hud.info.color + "," +
|
||||
"info_dir=" + hud.info.dir.ordinal() + "," +
|
||||
"info_shadow=" + (hud.info.shadow ? 1 : 0) + "," +
|
||||
"info_enable=" + (hud.info.enable ? 1 : 0) + "," +
|
||||
"lyric_x=" + hud.lyric.x + "," +
|
||||
"lyric_y=" + hud.lyric.y + "," +
|
||||
"lyric_color=" + hud.lyric.color + "," +
|
||||
"lyric_dir=" + hud.lyric.dir.ordinal() + "," +
|
||||
"lyric_shadow=" + (hud.lyric.shadow ? 1 : 0) + "," +
|
||||
"lyric_enable=" + (hud.lyric.enable ? 1 : 0) + "," +
|
||||
"list_x=" + hud.list.x + "," +
|
||||
"list_y=" + hud.list.y + "," +
|
||||
"list_color=" + hud.list.color + "," +
|
||||
"list_dir=" + hud.list.dir.ordinal() + "," +
|
||||
"list_shadow=" + (hud.list.shadow ? 1 : 0) + "," +
|
||||
"list_enable=" + (hud.list.enable ? 1 : 0) + "," +
|
||||
"pic_x=" + hud.pic.x + "," +
|
||||
"pic_y=" + hud.pic.y + "," +
|
||||
"pic_dir=" + hud.pic.dir.ordinal() + "," +
|
||||
"pic_enable=" + (hud.pic.enable ? 1 : 0) + "," +
|
||||
"pic_size=" + hud.pic.color + "," +
|
||||
"pic_rotate=" + (hud.pic.shadow ? 1 : 0) + "," +
|
||||
"pic_rotate_speed=" + hud.picRotateSpeed + " WHERE name='" + name + "'";
|
||||
stat.execute(sql);
|
||||
stat.close();
|
||||
} catch (Exception e) {
|
||||
@@ -160,22 +175,38 @@ public class DataSql {
|
||||
update(name, hud);
|
||||
} else {
|
||||
Statement stat = connection.createStatement();
|
||||
sql = MessageFormat.format("INSERT INTO allmusic (name,info_x,info_y," +
|
||||
"info_enable,lyric_x,lyric_y,lyric_enable,list_x,list_y,list_enable," +
|
||||
"pic_x,pic_y,pic_enable,pic_size,pic_rotate,pic_rotate_speed," +
|
||||
"info_color,info_dir,info_shadow,lyric_color,lyric_dir," +
|
||||
"lyric_shadow,list_color,list_dir,list_shadow,pic_dir)" +
|
||||
"VALUES (@name,{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24})",
|
||||
hud.info.x, hud.info.y, hud.info.enable ? 1 : 0,
|
||||
hud.lyric.x, hud.lyric.y, hud.lyric.enable ? 1 : 0,
|
||||
hud.list.x, hud.list.y, hud.list.enable ? 1 : 0,
|
||||
hud.pic.x, hud.pic.y, hud.pic.enable ? 1 : 0,
|
||||
hud.pic.color, hud.pic.shadow ? 1 : 0,
|
||||
hud.picRotateSpeed, hud.info.color, hud.info.dir.ordinal(),
|
||||
hud.info.shadow ? 1 : 0, hud.lyric.color, hud.lyric.dir.ordinal(),
|
||||
hud.lyric.shadow ? 1 : 0, hud.list.color, hud.list.dir.ordinal(),
|
||||
hud.list.shadow ? 1 : 0, hud.pic.dir.ordinal());
|
||||
sql = sql.replace("@name", "'" + name + "'");
|
||||
sql = "INSERT INTO allmusic (name,info_x,info_y," +
|
||||
"info_enable,lyric_x,lyric_y,lyric_enable,list_x,list_y,list_enable," +
|
||||
"pic_x,pic_y,pic_enable,pic_size,pic_rotate,pic_rotate_speed," +
|
||||
"info_color,info_dir,info_shadow,lyric_color,lyric_dir," +
|
||||
"lyric_shadow,list_color,list_dir,list_shadow,pic_dir)" +
|
||||
"VALUES (`" + name + "`," +
|
||||
hud.info.x + "," +
|
||||
hud.info.y + "," +
|
||||
(hud.info.enable ? 1 : 0) + "," +
|
||||
hud.lyric.x + "," +
|
||||
hud.lyric.y + "," +
|
||||
(hud.lyric.enable ? 1 : 0) + "," +
|
||||
hud.list.x + "," +
|
||||
hud.list.y + "," +
|
||||
(hud.list.enable ? 1 : 0) + "," +
|
||||
hud.pic.x + "," +
|
||||
hud.pic.y + "," +
|
||||
(hud.pic.enable ? 1 : 0) + "," +
|
||||
hud.pic.color + "," +
|
||||
(hud.pic.shadow ? 1 : 0) + "," +
|
||||
hud.picRotateSpeed + "," +
|
||||
hud.info.color + "," +
|
||||
hud.info.dir.ordinal() + "," +
|
||||
(hud.info.shadow ? 1 : 0) + "," +
|
||||
hud.lyric.color + "," +
|
||||
hud.lyric.dir.ordinal() + "," +
|
||||
(hud.lyric.shadow ? 1 : 0) + "," +
|
||||
hud.list.color + "," +
|
||||
hud.list.dir.ordinal() + "," +
|
||||
(hud.list.shadow ? 1 : 0) + "," +
|
||||
hud.pic.dir.ordinal() +
|
||||
")";
|
||||
stat.execute(sql);
|
||||
stat.close();
|
||||
}
|
||||
@@ -248,7 +279,7 @@ public class DataSql {
|
||||
/**
|
||||
* 读取空闲歌单列表
|
||||
*/
|
||||
private static void readAllList(){
|
||||
private static void readAllList() {
|
||||
try {
|
||||
AllMusic.log.info("正在读取空闲歌单");
|
||||
if (connection.isReadOnly() || connection.isClosed()) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class AllMusicBukkit extends JavaPlugin {
|
||||
}
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("Vault") != null
|
||||
&& AllMusic.getConfig().Economy.Vault) {
|
||||
&& AllMusic.getConfig().economy.vault) {
|
||||
try {
|
||||
VaultHook vault = new VaultHook();
|
||||
AllMusic.economy = vault;
|
||||
@@ -69,7 +69,7 @@ public class AllMusicBukkit extends JavaPlugin {
|
||||
AllMusic.log.info("§2PAPI未挂钩");
|
||||
}
|
||||
|
||||
if (AllMusic.getConfig().TopPAPI) {
|
||||
if (AllMusic.getConfig().topPAPI) {
|
||||
PlayMusic.nowPlayMusic = new TopSongInfoObj();
|
||||
PlayMusic.lyric = new TopLyricSave();
|
||||
pluginMessage = new PluginMessage();
|
||||
@@ -92,7 +92,7 @@ public class AllMusicBukkit extends JavaPlugin {
|
||||
@Override
|
||||
public void onDisable() {
|
||||
AllMusic.isRun = false;
|
||||
if (AllMusic.getConfig().TopPAPI)
|
||||
if (AllMusic.getConfig().topPAPI)
|
||||
pluginMessage.stop();
|
||||
else
|
||||
AllMusic.stop();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package coloryr.allmusic.side.bukkit;
|
||||
|
||||
import coloryr.allmusic.core.command.CommandEX;
|
||||
import coloryr.allmusic.core.command.TabCommand;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -24,7 +23,7 @@ public class CommandBukkit implements CommandExecutor, TabExecutor {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if (command.getName().equalsIgnoreCase("music")) {
|
||||
return TabCommand.getTabList(sender.getName(), args);
|
||||
return CommandEX.getTabList(sender.getName().toLowerCase(Locale.ROOT), args);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SideBukkit extends ISide {
|
||||
}
|
||||
if (UnpooledC != null) {
|
||||
try {
|
||||
bufferM = UnpooledC.getMethod("buffer", int.class);
|
||||
bufferM = UnpooledC.getMethod("buffer");
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class SideBukkit extends ISide {
|
||||
continue;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.LYRIC);
|
||||
writeByteM.invoke(buf, ComType.LYRIC.ordinal());
|
||||
writeString(buf, data);
|
||||
|
||||
send(player, buf);
|
||||
@@ -110,7 +110,7 @@ public class SideBukkit extends ISide {
|
||||
continue;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.INFO);
|
||||
writeByteM.invoke(buf, ComType.INFO.ordinal());
|
||||
writeString(buf, data);
|
||||
|
||||
send(player, buf);
|
||||
@@ -133,7 +133,7 @@ public class SideBukkit extends ISide {
|
||||
SaveObj obj = HudUtils.get(name);
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.HUD);
|
||||
writeByteM.invoke(buf, ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
|
||||
send(player, buf);
|
||||
@@ -189,7 +189,7 @@ public class SideBukkit extends ISide {
|
||||
continue;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.LIST);
|
||||
writeByteM.invoke(buf, ComType.LIST.ordinal());
|
||||
writeString(buf, data);
|
||||
|
||||
send(player, buf);
|
||||
@@ -208,7 +208,7 @@ public class SideBukkit extends ISide {
|
||||
SaveObj obj = HudUtils.get(Name);
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.HUD);
|
||||
writeByteM.invoke(buf, ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
|
||||
send(player, buf);
|
||||
@@ -246,7 +246,7 @@ public class SideBukkit extends ISide {
|
||||
continue;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.PLAY);
|
||||
writeByteM.invoke(buf, ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
|
||||
send(player, buf);
|
||||
@@ -267,7 +267,7 @@ public class SideBukkit extends ISide {
|
||||
if (AllMusic.isOK(player, null, false))
|
||||
return;
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.PLAY);
|
||||
writeByteM.invoke(buf, ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
|
||||
send(player1, buf);
|
||||
@@ -289,7 +289,7 @@ public class SideBukkit extends ISide {
|
||||
continue;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.IMG);
|
||||
writeByteM.invoke(buf, ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
|
||||
send(player, buf);
|
||||
@@ -309,7 +309,7 @@ public class SideBukkit extends ISide {
|
||||
if (AllMusic.isOK(player1.getName(), null, true))
|
||||
return;
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.IMG);
|
||||
writeByteM.invoke(buf, ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
|
||||
send(player1, buf);
|
||||
@@ -328,7 +328,7 @@ public class SideBukkit extends ISide {
|
||||
if (AllMusic.isOK(player1.getName(), null, true))
|
||||
return;
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.POS);
|
||||
writeByteM.invoke(buf, ComType.POS.ordinal());
|
||||
writeIntM.invoke(buf, pos);
|
||||
|
||||
send(player1, buf);
|
||||
@@ -343,7 +343,7 @@ public class SideBukkit extends ISide {
|
||||
try {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.STOP);
|
||||
writeByteM.invoke(buf, ComType.STOP.ordinal());
|
||||
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ public class SideBukkit extends ISide {
|
||||
return;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.STOP);
|
||||
writeByteM.invoke(buf, ComType.STOP.ordinal());
|
||||
send(player, buf);
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§d[AllMusic]§c停止指令发送出错");
|
||||
@@ -377,7 +377,7 @@ public class SideBukkit extends ISide {
|
||||
return;
|
||||
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.CLEAR);
|
||||
writeByteM.invoke(buf, ComType.CLEAR.ordinal());
|
||||
|
||||
send(player, buf);
|
||||
} catch (Exception e) {
|
||||
@@ -391,7 +391,7 @@ public class SideBukkit extends ISide {
|
||||
try {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
Object buf = bufferM.invoke(null);
|
||||
writeByteM.invoke(buf, ComType.CLEAR);
|
||||
writeByteM.invoke(buf, ComType.CLEAR.ordinal());
|
||||
|
||||
send(player, buf);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class AllMusicPAPI extends PlaceholderExpansion {
|
||||
|
||||
@Override
|
||||
public String onRequest(OfflinePlayer player, @NotNull String identifier) {
|
||||
if (AllMusic.getConfig().TopPAPI) {
|
||||
if (AllMusic.getConfig().topPAPI) {
|
||||
if (!PluginMessage.update) {
|
||||
PluginMessage.startUpdate();
|
||||
return "";
|
||||
@@ -87,19 +87,19 @@ public class AllMusicPAPI extends PlaceholderExpansion {
|
||||
}
|
||||
case "lyric": {
|
||||
if (PlayMusic.lyric == null || PlayMusic.lyric.getLyric() == null) {
|
||||
return AllMusic.getMessage().Lyric.Empty1;
|
||||
return AllMusic.getMessage().lyric.empty1;
|
||||
}
|
||||
return PlayMusic.lyric.getLyric();
|
||||
}
|
||||
case "tlyric": {
|
||||
if (PlayMusic.lyric == null || PlayMusic.lyric.getTlyric() == null) {
|
||||
return AllMusic.getMessage().Lyric.Empty2;
|
||||
return AllMusic.getMessage().lyric.empty2;
|
||||
}
|
||||
return PlayMusic.lyric.getTlyric();
|
||||
}
|
||||
case "klyric": {
|
||||
if (PlayMusic.lyric == null || PlayMusic.lyric.getKly() == null) {
|
||||
return AllMusic.getMessage().Lyric.Empty3;
|
||||
return AllMusic.getMessage().lyric.empty3;
|
||||
}
|
||||
return PlayMusic.lyric.getKly();
|
||||
}
|
||||
@@ -108,10 +108,10 @@ public class AllMusicPAPI extends PlaceholderExpansion {
|
||||
switch (identifier) {
|
||||
case "now_music_name": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return AllMusic.getMessage().PAPI.NoMusic;
|
||||
if (AllMusic.getConfig().MessageLimit
|
||||
&& PlayMusic.nowPlayMusic.getName().length() > AllMusic.getConfig().MessageLimitSize) {
|
||||
return PlayMusic.nowPlayMusic.getName().substring(0, AllMusic.getConfig().MessageLimitSize);
|
||||
return AllMusic.getMessage().papi.emptyMusic;
|
||||
if (AllMusic.getConfig().messageLimit
|
||||
&& PlayMusic.nowPlayMusic.getName().length() > AllMusic.getConfig().messageLimitSize) {
|
||||
return PlayMusic.nowPlayMusic.getName().substring(0, AllMusic.getConfig().messageLimitSize);
|
||||
}
|
||||
return PlayMusic.nowPlayMusic.getName();
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class AllMusicPAPI extends PlaceholderExpansion {
|
||||
return PlayMusic.nowPlayMusic.getInfo();
|
||||
}
|
||||
case "list_size": {
|
||||
return "" + PlayMusic.getSize();
|
||||
return "" + PlayMusic.getListSize();
|
||||
}
|
||||
case "music_list": {
|
||||
return PlayMusic.getAllList();
|
||||
|
||||
@@ -16,8 +16,8 @@ import org.slf4j.Logger;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
@Plugin(id = "allmusic", name = "AllMusic", version = AllMusic.version,
|
||||
url = "https://github.com/Coloryr/AllMusic_Server", description = "全服点歌插件", authors = {"Color_yr"})
|
||||
@Plugin(id = "allmusic", name = "AllMusic3", version = AllMusic.version,
|
||||
url = "https://github.com/Coloryr/AllMusic3_Server", description = "全服点歌插件", authors = {"Color_yr"})
|
||||
public class AllMusicVelocity {
|
||||
public static AllMusicVelocity plugin;
|
||||
public static ChannelIdentifier channel;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(0);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF(AllMusic.getMessage().papi.NoMusic);
|
||||
out.writeUTF(AllMusic.getMessage().papi.emptyMusic);
|
||||
else {
|
||||
if (AllMusic.getConfig().messageLimit
|
||||
&& PlayMusic.nowPlayMusic.getName().length() > AllMusic.getConfig().messageLimitSize) {
|
||||
@@ -148,7 +148,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (!obj.lyric.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.lyric.ordinal());
|
||||
buf.writeByte(ComType.LYRIC.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (!obj.info.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.info.ordinal());
|
||||
buf.writeByte(ComType.INFO.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (!obj.list.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.list.ordinal());
|
||||
buf.writeByte(ComType.LIST.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
SaveObj obj = HudUtils.get(player.getName());
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.hud.ordinal());
|
||||
buf.writeByte(ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
} catch (Exception e1) {
|
||||
@@ -237,7 +237,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (AllMusic.isOK(player.getName(), server, false))
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.play.ordinal());
|
||||
buf.writeByte(ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player, buf);
|
||||
AllMusic.addNowPlayPlayer(player.getName());
|
||||
@@ -259,7 +259,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
return;
|
||||
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.play.ordinal());
|
||||
buf.writeByte(ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player1, buf);
|
||||
} catch (Exception e) {
|
||||
@@ -281,7 +281,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
SaveObj obj = HudUtils.get(player);
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.hud.ordinal());
|
||||
buf.writeByte(ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player1, buf);
|
||||
} catch (Exception e) {
|
||||
@@ -305,13 +305,13 @@ public class SideBC extends ISide implements IEconomy {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
switch (pos) {
|
||||
case INFO:
|
||||
buf.writeByte(ComType.info.ordinal());
|
||||
buf.writeByte(ComType.INFO.ordinal());
|
||||
break;
|
||||
case LIST:
|
||||
buf.writeByte(ComType.list.ordinal());
|
||||
buf.writeByte(ComType.LIST.ordinal());
|
||||
break;
|
||||
case LYRIC:
|
||||
buf.writeByte(ComType.lyric.ordinal());
|
||||
buf.writeByte(ComType.LYRIC.ordinal());
|
||||
break;
|
||||
}
|
||||
writeString(buf, data);
|
||||
@@ -334,7 +334,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (!obj.pic.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.img.ordinal());
|
||||
buf.writeByte(ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -353,7 +353,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (ok(player1))
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.img.ordinal());
|
||||
buf.writeByte(ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player1, buf);
|
||||
} catch (Exception e) {
|
||||
@@ -371,7 +371,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (ok(player1))
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.pos.ordinal());
|
||||
buf.writeByte(ComType.POS.ordinal());
|
||||
buf.writeInt(pos);
|
||||
send(player1, buf);
|
||||
} catch (Exception e) {
|
||||
@@ -385,7 +385,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
try {
|
||||
for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.stop.ordinal());
|
||||
buf.writeByte(ComType.STOP.ordinal());
|
||||
send(player, buf);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -401,7 +401,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (player == null)
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.stop.ordinal());
|
||||
buf.writeByte(ComType.STOP.ordinal());
|
||||
send(player, buf);
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§d[AllMusic]§c停止指令发送出错");
|
||||
@@ -416,7 +416,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
if (player == null)
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.clear.ordinal());
|
||||
buf.writeByte(ComType.CLEAR.ordinal());
|
||||
send(player, buf);
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§d[AllMusic]§c清空Hud发生出错");
|
||||
@@ -430,7 +430,7 @@ public class SideBC extends ISide implements IEconomy {
|
||||
Collection<ProxiedPlayer> values = ProxyServer.getInstance().getPlayers();
|
||||
for (ProxiedPlayer player : values) {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.clear.ordinal());
|
||||
buf.writeByte(ComType.CLEAR.ordinal());
|
||||
send(player, buf);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(0);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF(AllMusic.getMessage().papi.NoMusic);
|
||||
out.writeUTF(AllMusic.getMessage().papi.emptyMusic);
|
||||
else {
|
||||
if (AllMusic.getConfig().messageLimit
|
||||
&& PlayMusic.nowPlayMusic.getName().length() > AllMusic.getConfig().messageLimitSize) {
|
||||
@@ -196,7 +196,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
try {
|
||||
for (Player player : AllMusicVelocity.plugin.server.getAllPlayers()) {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.stop.ordinal());
|
||||
buf.writeByte(ComType.STOP.ordinal());
|
||||
send(player, buf);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -212,7 +212,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (!player.isPresent())
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.stop.ordinal());
|
||||
buf.writeByte(ComType.STOP.ordinal());
|
||||
send(player.get(), buf);
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§d[AllMusic]§c停止指令发送出错");
|
||||
@@ -229,7 +229,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (AllMusic.isOK(player.getUsername(), server, false))
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.play.ordinal());
|
||||
buf.writeByte(ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player, buf);
|
||||
AllMusic.addNowPlayPlayer(player.getUsername());
|
||||
@@ -250,7 +250,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (AllMusic.isOK(player1.getUsername(), server, false))
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.play.ordinal());
|
||||
buf.writeByte(ComType.PLAY.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player1, buf);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (!obj.pic.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.img.ordinal());
|
||||
buf.writeByte(ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (ok(player1))
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.img.ordinal());
|
||||
buf.writeByte(ComType.IMG.ordinal());
|
||||
writeString(buf, url);
|
||||
send(player1, buf);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (ok(player1))
|
||||
return;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.pos.ordinal());
|
||||
buf.writeByte(ComType.POS.ordinal());
|
||||
buf.writeInt(pos);
|
||||
send(player1, buf);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (!obj.lyric.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.lyric.ordinal());
|
||||
buf.writeByte(ComType.LYRIC.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (!obj.info.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.info.ordinal());
|
||||
buf.writeByte(ComType.INFO.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
SaveObj obj = HudUtils.get(name);
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.hud.ordinal());
|
||||
buf.writeByte(ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player.get(), buf);
|
||||
} catch (Exception e) {
|
||||
@@ -391,13 +391,13 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
switch (pos) {
|
||||
case INFO:
|
||||
buf.writeByte(ComType.info.ordinal());
|
||||
buf.writeByte(ComType.INFO.ordinal());
|
||||
break;
|
||||
case LIST:
|
||||
buf.writeByte(ComType.list.ordinal());
|
||||
buf.writeByte(ComType.LIST.ordinal());
|
||||
break;
|
||||
case LYRIC:
|
||||
buf.writeByte(ComType.lyric.ordinal());
|
||||
buf.writeByte(ComType.LYRIC.ordinal());
|
||||
break;
|
||||
}
|
||||
writeString(buf, data);
|
||||
@@ -420,7 +420,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
if (!obj.list.enable)
|
||||
continue;
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.list.ordinal());
|
||||
buf.writeByte(ComType.LIST.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
}
|
||||
@@ -437,7 +437,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
SaveObj obj = HudUtils.get(player.getUsername());
|
||||
String data = AllMusic.gson.toJson(obj);
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.hud.ordinal());
|
||||
buf.writeByte(ComType.HUD.ordinal());
|
||||
writeString(buf, data);
|
||||
send(player, buf);
|
||||
} catch (Exception e1) {
|
||||
@@ -470,7 +470,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
return;
|
||||
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.clear.ordinal());
|
||||
buf.writeByte(ComType.CLEAR.ordinal());
|
||||
send(player.get(), buf);
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§d[AllMusic]§c清空Hud发生出错");
|
||||
@@ -484,7 +484,7 @@ public class SideVelocity extends ISide implements IEconomy {
|
||||
Collection<Player> values = AllMusicVelocity.plugin.server.getAllPlayers();
|
||||
for (Player player : values) {
|
||||
ByteBuf buf = Unpooled.buffer();
|
||||
buf.writeByte(ComType.clear.ordinal());
|
||||
buf.writeByte(ComType.CLEAR.ordinal());
|
||||
send(player, buf);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: AllMusic
|
||||
name: AllMusic3
|
||||
main: coloryr.allmusic.AllMusicBC
|
||||
author: Color_yr
|
||||
version: 3.0.0
|
||||
Reference in new issue
Block a user