diff --git a/core/AllMusic.java b/core/AllMusic.java index 7c02966c..13928448 100644 --- a/core/AllMusic.java +++ b/core/AllMusic.java @@ -6,10 +6,10 @@ import coloryr.allmusic.core.music.api.APIMain; import coloryr.allmusic.core.music.play.MusicSearch; import coloryr.allmusic.core.music.play.PlayGo; import coloryr.allmusic.core.music.play.PlayMusic; -import coloryr.allmusic.core.objs.ConfigObj; +import coloryr.allmusic.core.objs.config.ConfigObj; import coloryr.allmusic.core.objs.CookieObj; -import coloryr.allmusic.core.objs.MessageObj; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.message.MessageObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.SearchPageObj; import coloryr.allmusic.core.side.IMyLogger; import coloryr.allmusic.core.side.ISide; @@ -41,11 +41,11 @@ public class AllMusic { /** * 配置文件版本号 */ - public static final String configVersion = "103"; + public static final String configVersion = "104"; /** * 语言文件配置版本号 */ - public static final String messageVersion = "104"; + public static final String messageVersion = "105"; /** * 搜歌结果 * 玩家名 结果 @@ -108,13 +108,10 @@ public class AllMusic { * 检查配置文件完整性 */ public static void configCheck() { - if (config == null) { - config = ConfigObj.makeDefault(); + if (config == null || config.check()) { + config = ConfigObj.make(); log.warning("§d[AllMusic]§c配置文件config.json错误,已覆盖"); - save(); - } else if (config.check()) { - log.warning("§d[AllMusic]§c配置文件config.json错误,已覆盖"); - save(); + saveConfig(); } } @@ -122,13 +119,10 @@ public class AllMusic { * 检查语言文件完整性 */ private static void messageCheck() { - if (message == null) { - message = new MessageObj(); + if (message == null || message.check()) { + message = MessageObj.make(); log.warning("§d[AllMusic]§c配置文件message.json错误,已覆盖"); - save(); - } else if (message.check()) { - log.warning("§d[AllMusic]§c配置文件message.json错误,已覆盖"); - save(); + saveMessage(); } } @@ -142,8 +136,7 @@ public class AllMusic { */ public static boolean isOK(String name, String server, boolean checkList) { try { - if (AllMusic.getConfig().NoMusicServer - .contains(server)) + if (AllMusic.getConfig().NoMusicServer.contains(server)) return true; if (server != null && AllMusic.getConfig().NoMusicPlayer.contains(name)) return true; @@ -173,7 +166,7 @@ public class AllMusic { public static ConfigObj getConfig() { if (config == null) { log.warning("§d[AllMusic]§c配置文件config.json错误,已使用默认配置文件"); - config = ConfigObj.makeDefault(); + config = ConfigObj.make(); } return config; } @@ -186,7 +179,7 @@ public class AllMusic { public static MessageObj getMessage() { if (message == null) { log.warning("§d[AllMusic]§c配置文件message.json错误,已使用默认配置文件"); - message = new MessageObj(); + message = MessageObj.make(); } return message; } @@ -285,7 +278,7 @@ public class AllMusic { /** * 保存配置文件 */ - public static void save() { + public static void saveConfig() { try { String data = new GsonBuilder().setPrettyPrinting().create().toJson(config); FileOutputStream out = new FileOutputStream(configFile); @@ -293,12 +286,22 @@ public class AllMusic { out, StandardCharsets.UTF_8); write.write(data); write.close(); - data = new GsonBuilder().setPrettyPrinting().create().toJson(message); - out = new FileOutputStream(messageFile); - write = new OutputStreamWriter( + out.close(); + } catch (Exception e) { + log.warning("§d[AllMusic]§c配置文件保存错误"); + e.printStackTrace(); + } + } + + public static void saveMessage() { + try { + String data = new GsonBuilder().setPrettyPrinting().create().toJson(message); + FileOutputStream out = new FileOutputStream(messageFile); + OutputStreamWriter write = new OutputStreamWriter( out, StandardCharsets.UTF_8); write.write(data); write.close(); + out.close(); } catch (Exception e) { log.warning("§d[AllMusic]§c配置文件保存错误"); e.printStackTrace(); @@ -330,6 +333,7 @@ public class AllMusic { PlayGo.start(); MusicSearch.start(); DataSql.start(); + AllMusic.apiMusic = new APIMain(); log.info("§d[AllMusic]§e已启动-" + version); } @@ -358,9 +362,6 @@ public class AllMusic { * @return 音乐API */ public static APIMain getMusicApi() { - if (apiMusic == null) { - AllMusic.apiMusic = new APIMain(); - } return apiMusic; } @@ -449,9 +450,9 @@ public class AllMusic { if (!file.exists()) file.mkdir(); if (configFile == null) - configFile = new File(file, "core/config.json"); + configFile = new File(file, "config.json"); if (messageFile == null) - messageFile = new File(file, "core/message.json"); + messageFile = new File(file, "message.json"); if (cookieFile == null) cookieFile = new File(file, "cookie.json"); if (Logs.file == null) @@ -459,10 +460,10 @@ public class AllMusic { if (DataSql.sqlFile == null) DataSql.sqlFile = new File(file, "data.db"); if (!configFile.exists()) { - Files.copy(this.getClass().getResourceAsStream("/core/config.json"), configFile.toPath()); + configFile.createNewFile(); } if (!messageFile.exists()) { - Files.copy(this.getClass().getResourceAsStream("/core/message.json"), messageFile.toPath()); + messageFile.createNewFile(); } if (!cookieFile.exists()) { cookieFile.createNewFile(); diff --git a/core/command/CommandEX.java b/core/command/CommandEX.java index 7ac17ea1..c7b873c7 100644 --- a/core/command/CommandEX.java +++ b/core/command/CommandEX.java @@ -156,7 +156,7 @@ public class CommandEX { for (int a = 0; a < index; a++) { item = search.getRes(a + search.getPage() * 10); info = AllMusic.getMessage().Page.Choice; - info = info.replace("%index%", "" + (a + 1)) + info = info.replace("%Index%", "" + (a + 1)) .replace("%MusicName%", item.name) .replace("%MusicAuthor%", item.author) .replace("%MusicAl%", item.al); @@ -223,7 +223,9 @@ public class CommandEX { AllMusic.side.sendMessageRun(sender, AllMusic.getMessage().Help.Admin.ClearList, AllMusic.getMessage().Click.This, "/music clearlist"); AllMusic.side.sendMessageRun(sender, AllMusic.getMessage().Help.Admin.Login, - AllMusic.getMessage().Click.This, "/music login"); + AllMusic.getMessage().Click.Check, "/music login "); + AllMusic.side.sendMessageRun(sender, AllMusic.getMessage().Help.Admin.Code, + AllMusic.getMessage().Click.This, "/music code"); } return; } else if (args[0].equalsIgnoreCase("stop")) { @@ -249,7 +251,7 @@ public class CommandEX { AllMusic.side.sendMessage(sender, AllMusic.getMessage().MusicPlay.NoPlay); } else { AllMusic.side.sendMessage(sender, AllMusic.getMessage().MusicPlay.ListMusic.Head - .replace("&Count&", "" + PlayMusic.getSize())); + .replace("%Count%", "" + PlayMusic.getSize())); AllMusic.side.sendMessage(sender, PlayMusic.getAllList()); } return; @@ -262,11 +264,12 @@ public class CommandEX { if (PlayMusic.getSize() == 0 && AllMusic.getConfig().PlayList.size() == 0) { AllMusic.side.sendMessage(sender, AllMusic.getMessage().MusicPlay.NoPlay); } else if (PlayMusic.voteTime == 0) { - PlayMusic.voteTime = 30; + PlayMusic.voteTime = AllMusic.getConfig().VoteTime; AllMusic.addVote(name); AllMusic.side.sendMessage(sender, AllMusic.getMessage().Vote.DoVote); String data = AllMusic.getMessage().Vote.BQ; - AllMusic.side.bq(data.replace("%PlayerName%", name)); + AllMusic.side.bq(data.replace("%PlayerName%", name) + .replace("%Time%", String.valueOf(AllMusic.getConfig().VoteTime))); } else if (PlayMusic.voteTime > 0) { if (!AllMusic.containVote(name)) { AllMusic.addVote(name); @@ -477,7 +480,7 @@ public class CommandEX { return; } else if (args[0].equalsIgnoreCase("clearlist")) { AllMusic.getConfig().PlayList.clear(); - AllMusic.save(); + AllMusic.saveConfig(); AllMusic.side.sendMessage(sender, "§d[AllMusic]§2添加空闲音乐列表已清空"); return; } else if (args[0].equalsIgnoreCase("code")) { diff --git a/core/hud/DataSql.java b/core/hud/DataSql.java index b61a6556..ac8e71c5 100644 --- a/core/hud/DataSql.java +++ b/core/hud/DataSql.java @@ -2,7 +2,7 @@ package coloryr.allmusic.core.hud; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.objs.hud.PosObj; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import java.io.File; import java.sql.Connection; diff --git a/core/hud/HudUtils.java b/core/hud/HudUtils.java index d4c3131f..b33266d2 100644 --- a/core/hud/HudUtils.java +++ b/core/hud/HudUtils.java @@ -5,7 +5,7 @@ import coloryr.allmusic.core.enums.HudPos; import coloryr.allmusic.core.music.play.LyricSave; import coloryr.allmusic.core.music.play.PlayMusic; import coloryr.allmusic.core.objs.hud.PosObj; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.utils.Function; import com.google.gson.Gson; @@ -78,7 +78,7 @@ public class HudUtils { posOBJ.y = y1; addAndSave(player, obj); - AllMusic.save(); + AllMusic.saveConfig(); HudUtils.sendHudPos(player); return posOBJ; } @@ -216,7 +216,7 @@ public class HudUtils { } clearHud(player); addAndSave(player, obj); - AllMusic.save(); + AllMusic.saveConfig(); HudUtils.sendHudPos(player); if (pos == null) { return res; @@ -264,7 +264,7 @@ public class HudUtils { if (obj == null) { obj = AllMusic.getConfig().DefaultHud.copy(); addAndSave(player, obj); - AllMusic.save(); + AllMusic.saveConfig(); } String data = new Gson().toJson(obj); AllMusic.side.send(data, player); diff --git a/core/music/api/APIMain.java b/core/music/api/APIMain.java index 7c23b5ac..32d1f86f 100644 --- a/core/music/api/APIMain.java +++ b/core/music/api/APIMain.java @@ -4,7 +4,6 @@ import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.enums.EncryptType; import coloryr.allmusic.core.music.play.LyricDo; import coloryr.allmusic.core.music.play.LyricSave; -import coloryr.allmusic.core.music.play.PlayMusic; import coloryr.allmusic.core.objs.HttpResObj; import coloryr.allmusic.core.objs.SearchMusicObj; import coloryr.allmusic.core.objs.api.music.info.InfoObj; @@ -209,7 +208,7 @@ public class APIMain { isUpdata = true; DataObj obj = AllMusic.gson.fromJson(res.data, DataObj.class); AllMusic.getConfig().PlayList.addAll(obj.getPlaylist()); - AllMusic.save(); + AllMusic.saveConfig(); AllMusic.side.sendMessaget(sender, AllMusic.getMessage().MusicPlay.ListMusic.Get.replace("%ListName%", obj.getName())); } catch (Exception e) { AllMusic.log.warning("§d[AllMusic]§c歌曲列表获取错误"); diff --git a/core/music/play/PlayMusic.java b/core/music/play/PlayMusic.java index aec4624f..07e63197 100644 --- a/core/music/play/PlayMusic.java +++ b/core/music/play/PlayMusic.java @@ -204,7 +204,7 @@ public class PlayMusic { for (int i = 0; i < playList.size(); i++) { info = playList.get(i); a = AllMusic.getMessage().MusicPlay.ListMusic.Item; - a = a.replace("%index%", "" + (i + 1)) + a = a.replace("%Index%", "" + (i + 1)) .replace("%MusicName%", info.getName()) .replace("%MusicAuthor%", info.getAuthor()) .replace("%MusicAl%", info.getAl()) diff --git a/core/objs/ConfigObj.java b/core/objs/config/ConfigObj.java similarity index 68% rename from core/objs/ConfigObj.java rename to core/objs/config/ConfigObj.java index 7df3e2da..c131704b 100644 --- a/core/objs/ConfigObj.java +++ b/core/objs/config/ConfigObj.java @@ -1,9 +1,6 @@ -package coloryr.allmusic.core.objs; +package coloryr.allmusic.core.objs.config; import coloryr.allmusic.core.AllMusic; -import coloryr.allmusic.core.objs.config.EconomyObj; -import coloryr.allmusic.core.objs.config.FunConfigObj; -import coloryr.allmusic.core.objs.hud.SaveObj; import java.util.ArrayList; import java.util.List; @@ -20,6 +17,10 @@ public class ConfigObj { * 最小通过投票数 */ public int MinVote; + /** + * 投票时间 + */ + public int VoteTime; /** * 歌曲延迟 */ @@ -141,67 +142,21 @@ public class ConfigObj { */ public FunConfigObj FunConfig; - public static ConfigObj makeDefault(){ - return new ConfigObj(){{ - MaxList = 10; - MinVote = 3; - Delay = 0; - Admin = new ArrayList() {{ - this.add("CONSOLE"); - }}; - NoMusicServer = new ArrayList<>(); - NoMusicPlayer = new ArrayList<>(); - BanMusic = new ArrayList<>(); - PlayList = new ArrayList<>(); - PlayListSwitch = true; - PlayListRandom = true; - SendLyric = true; - NeedPermission = false; - DefaultHud = new SaveObj(); - - UseCost = false; - SearchCost = 20; - MutePlayMessage = false; - MuteAddMessage = false; - ShowInBar = false; - AddMusicCost = 10; - - DefaultAddMusic = 0; - LoginUser = ""; - - MusicBR = "320000"; - - MaxMusicTime = 600; - - TopPAPI = false; - MessageLimit = false; - MessageLimitSize = 40; - - Economy = new EconomyObj(); - FunConfig = new FunConfigObj(); - - KtvMode = true; - KDelay = 0; - - Version = AllMusic.version; - }}; - } - public void addBanID(String ID) { if (!BanMusic.contains(ID)) BanMusic.add(ID); - AllMusic.save(); + AllMusic.saveConfig(); } public void AddNoMusicPlayer(String ID) { if (!NoMusicPlayer.contains(ID)) NoMusicPlayer.add(ID); - AllMusic.save(); + AllMusic.saveConfig(); } public void RemoveNoMusicPlayer(String ID) { NoMusicPlayer.remove(ID); - AllMusic.save(); + AllMusic.saveConfig(); } public boolean check() { @@ -220,7 +175,7 @@ public class ConfigObj { } if (DefaultHud == null) { saveConfig = true; - DefaultHud = new SaveObj(); + DefaultHud = SaveObj.make(); } if (NoMusicPlayer == null) { saveConfig = true; @@ -230,19 +185,68 @@ public class ConfigObj { saveConfig = true; NoMusicServer = new ArrayList<>(); } - if (Economy == null) { + if (Economy == null || Economy.check()) { saveConfig = true; - Economy = new EconomyObj(); - } else if (Economy.check()) { - saveConfig = true; - Economy = new EconomyObj(); + Economy = EconomyObj.make(); } - if (FunConfig == null) { saveConfig = true; - FunConfig = new FunConfigObj(); + FunConfig = FunConfigObj.make(); } return saveConfig; } + + public void init() { + MaxList = 10; + MinVote = 3; + VoteTime = 30; + Delay = 0; + Admin = new ArrayList() {{ + add("CONSOLE"); + add("Color_yr"); + }}; + NoMusicServer = new ArrayList<>(); + NoMusicPlayer = new ArrayList<>(); + BanMusic = new ArrayList<>(); + PlayList = new ArrayList<>(); + PlayListSwitch = true; + PlayListRandom = true; + SendLyric = true; + NeedPermission = false; + DefaultHud = SaveObj.make(); + + UseCost = false; + SearchCost = 20; + MutePlayMessage = false; + MuteAddMessage = false; + ShowInBar = false; + AddMusicCost = 10; + + DefaultAddMusic = 0; + LoginUser = ""; + + MusicBR = "320000"; + + MaxMusicTime = 600; + + TopPAPI = false; + MessageLimit = false; + MessageLimitSize = 40; + + Economy = EconomyObj.make(); + FunConfig = FunConfigObj.make(); + + KtvMode = true; + KDelay = 0; + + Version = AllMusic.configVersion; + } + + public static ConfigObj make() { + ConfigObj config = new ConfigObj(); + config.init(); + + return config; + } } \ No newline at end of file diff --git a/core/objs/config/EconomyObj.java b/core/objs/config/EconomyObj.java index c570345d..58272877 100644 --- a/core/objs/config/EconomyObj.java +++ b/core/objs/config/EconomyObj.java @@ -2,17 +2,25 @@ package coloryr.allmusic.core.objs.config; public class EconomyObj { public String MysqlUrl; + public String Backend; public boolean Vault; - public EconomyObj() { - MysqlUrl = "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true"; - Vault = true; - } - public boolean check() { boolean res = MysqlUrl == null; return res; } + public void init(){ + Backend = "Server1"; + MysqlUrl = "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true"; + Vault = true; + } + + public static EconomyObj make() { + EconomyObj obj = new EconomyObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/config/FunConfigObj.java b/core/objs/config/FunConfigObj.java index 7a675e24..f8cf16c6 100644 --- a/core/objs/config/FunConfigObj.java +++ b/core/objs/config/FunConfigObj.java @@ -4,8 +4,15 @@ public class FunConfigObj { public boolean Rain; public int RainRate; - public FunConfigObj(){ + public void init() { Rain = true; RainRate = 10; } + + public static FunConfigObj make() { + FunConfigObj obj = new FunConfigObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/hud/SaveObj.java b/core/objs/config/SaveObj.java similarity index 55% rename from core/objs/hud/SaveObj.java rename to core/objs/config/SaveObj.java index d5345761..988a8006 100644 --- a/core/objs/hud/SaveObj.java +++ b/core/objs/config/SaveObj.java @@ -1,4 +1,6 @@ -package coloryr.allmusic.core.objs.hud; +package coloryr.allmusic.core.objs.config; + +import coloryr.allmusic.core.objs.hud.PosObj; public class SaveObj { public PosObj List; @@ -13,20 +15,6 @@ public class SaveObj { public boolean EnableInfo; public boolean EnablePic; - public SaveObj() { - EnableList = true; - EnableLyric = true; - EnableInfo = true; - EnablePic = true; - EnablePicRotate = true; - PicRotateSpeed = 10; - List = new PosObj(); - Lyric = new PosObj(); - Info = new PosObj(); - Pic = new PosObj(); - PicSize = 70; - } - public SaveObj copy() { SaveObj obj1 = new SaveObj(); obj1.EnableInfo = this.EnableInfo; @@ -42,4 +30,46 @@ public class SaveObj { obj1.PicRotateSpeed = this.PicRotateSpeed; return obj1; } + + public boolean check() { + boolean save = false; + if (List == null) { + save = true; + List = new PosObj(2, 74); + } + if (Lyric == null) { + save = true; + Lyric = new PosObj(74, 53); + } + if (Info == null) { + save = true; + Info = new PosObj(74, 2); + } + if (Pic == null) { + save = true; + Pic = new PosObj(2, 2); + } + return save; + } + + public void init() { + EnableList = true; + EnableLyric = true; + EnableInfo = true; + EnablePic = true; + EnablePicRotate = true; + PicRotateSpeed = 10; + List = new PosObj(2, 74); + Lyric = new PosObj(74, 53); + Info = new PosObj(74, 2); + Pic = new PosObj(2, 2); + PicSize = 70; + } + + public static SaveObj make() { + SaveObj obj = new SaveObj(); + obj.init(); + + return obj; + } } \ No newline at end of file diff --git a/core/objs/message/AddMusicObj.java b/core/objs/message/AddMusicObj.java index e5c41c2c..55f41d1b 100644 --- a/core/objs/message/AddMusicObj.java +++ b/core/objs/message/AddMusicObj.java @@ -10,17 +10,6 @@ public class AddMusicObj { public String Cancel; public String TimeOut; - public AddMusicObj() { - ListFull = "§d[AllMusic]§c错误,队列已满"; - BanMusic = "§d[AllMusic]§c错误,这首歌被禁点了"; - ExistMusic = "§d[AllMusic]§c错误,这首歌已经存在了"; - Success = "§d[AllMusic]§2点歌成功"; - NoPlayer = "§d[AllMusic]§c没有播放的玩家"; - NoID = "§d[AllMusic]§c错误,请输入歌曲数字ID"; - Cancel = "§d[AllMusic]§e点歌被取消"; - TimeOut = "§d[AllMusic]§e点歌被取消,音乐长度过长"; - } - public boolean check() { if (ListFull == null) return true; @@ -38,4 +27,22 @@ public class AddMusicObj { return true; return TimeOut == null; } + + public void init(){ + ListFull = "§d[AllMusic]§c错误,队列已满"; + BanMusic = "§d[AllMusic]§c错误,这首歌被禁点了"; + ExistMusic = "§d[AllMusic]§c错误,这首歌已经存在了"; + Success = "§d[AllMusic]§2点歌成功"; + NoPlayer = "§d[AllMusic]§c没有播放的玩家"; + NoID = "§d[AllMusic]§c错误,请输入歌曲数字ID"; + Cancel = "§d[AllMusic]§e点歌被取消"; + TimeOut = "§d[AllMusic]§e点歌被取消,音乐长度过长"; + } + + public static AddMusicObj make() { + AddMusicObj obj = new AddMusicObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/ClickObj.java b/core/objs/message/ClickObj.java index 2df00562..c54c3e39 100644 --- a/core/objs/message/ClickObj.java +++ b/core/objs/message/ClickObj.java @@ -4,14 +4,21 @@ public class ClickObj { public String This; public String Check; - public ClickObj() { - This = "§b[§n点我选择§r§b]"; - Check = "§b[§n点我查看§r§b]"; - } - public boolean check() { if (This == null) return true; return Check == null; } + + public void init(){ + This = "§b[§n点我选择§r§b]"; + Check = "§b[§n点我查看§r§b]"; + } + + public static ClickObj make() { + ClickObj obj = new ClickObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/CommandObj.java b/core/objs/message/CommandObj.java index 6f528da6..be200588 100644 --- a/core/objs/message/CommandObj.java +++ b/core/objs/message/CommandObj.java @@ -4,14 +4,21 @@ public class CommandObj { public String Error; public String NoPer; - public CommandObj() { - Error = "§d[AllMusic]§c参数错误,请输入/music help获取帮助"; - NoPer = "§d[AllMusic]§c你没有权限点歌"; - } - public boolean check() { if (Error == null) return true; return NoPer == null; } + + public void init() { + Error = "§d[AllMusic]§c参数错误,请输入/music help获取帮助"; + NoPer = "§d[AllMusic]§c你没有权限点歌"; + } + + public static CommandObj make() { + CommandObj obj = new CommandObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/CostObj.java b/core/objs/message/CostObj.java index f02a6ef0..5b7a5e2b 100644 --- a/core/objs/message/CostObj.java +++ b/core/objs/message/CostObj.java @@ -6,13 +6,6 @@ public class CostObj { public String NoMoney; public String CostFail; - public CostObj() { - Search = "§d[ALLMusic]§2你搜歌花费了%Cost%"; - AddMusic = "§d[ALLMusic]§2你点歌花费了%Cost%"; - NoMoney = "§d[ALLMusic]§c你没有足够的钱"; - CostFail = "§d[ALLMusic]§c扣钱过程中错误"; - } - public boolean check() { if (Search == null) return true; @@ -22,4 +15,18 @@ public class CostObj { return true; return CostFail == null; } + + public void init(){ + Search = "§d[AllMusic]§e你搜歌花费了%Cost%"; + AddMusic = "§d[ALLMusic]§e你点歌花费了%Cost%"; + NoMoney = "§d[ALLMusic]§c你没有足够的钱"; + CostFail = "§d[ALLMusic]§c扣钱过程中错误"; + } + + public static CostObj make() { + CostObj obj = new CostObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/CustomObj.java b/core/objs/message/CustomObj.java index c555efc1..df3a1cf3 100644 --- a/core/objs/message/CustomObj.java +++ b/core/objs/message/CustomObj.java @@ -3,11 +3,18 @@ package coloryr.allmusic.core.objs.message; public class CustomObj { public String Info; - public CustomObj() { - Info = "自定义音乐"; - } - public boolean check() { return Info == null; } + + public void init(){ + Info = "自定义音乐"; + } + + public static CustomObj make() { + CustomObj obj = new CustomObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/FunObj.java b/core/objs/message/FunObj.java index c39776d1..fa7586b4 100644 --- a/core/objs/message/FunObj.java +++ b/core/objs/message/FunObj.java @@ -3,18 +3,23 @@ package coloryr.allmusic.core.objs.message; public class FunObj { public String Rain; - public FunObj() - { - Rain = "§d[AllMusic]§e天空开始变得湿润"; - } - - public boolean check(){ - boolean res =false; - if(Rain == null) - { + public boolean check() { + boolean res = false; + if (Rain == null) { res = true; } return res; } + + public void init(){ + Rain = "§d[AllMusic]§e天空开始变得湿润"; + } + + public static FunObj make() { + FunObj obj = new FunObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/HelpAdminObj.java b/core/objs/message/HelpAdminObj.java index 74e67bbb..afff19ad 100644 --- a/core/objs/message/HelpAdminObj.java +++ b/core/objs/message/HelpAdminObj.java @@ -9,17 +9,7 @@ public class HelpAdminObj { public String AddList; public String ClearList; public String Login; - - public HelpAdminObj() { - Reload = "§d[AllMusic]§2使用/music reload 重读配置文件"; - Next = "§d[AllMusic]§2使用/music next 强制切歌"; - Ban = "§d[AllMusic]§2使用/music ban [ID] 禁止点这首歌"; - Url = "§d[AllMusic]§2使用/music url [url] 播放一首自定义歌曲"; - Delete = "§d[AllMusic]§2使用/music delete [序号] 删除队列中的歌曲"; - AddList = "§d[AllMusic]§2使用/music addlist [歌单ID] 添加歌单到空闲列表"; - ClearList = "§d[AllMusic]§2使用/music clearlist 清空空闲歌单"; - Login = "§d[AllMusic]§2使用/music login 重新登录账户"; - } + public String Code; public boolean check() { if (Reload == null) @@ -36,6 +26,27 @@ public class HelpAdminObj { return true; if (ClearList == null) return true; + if (Code == null) + return true; return Login == null; } + + public void init(){ + Reload = "§d[AllMusic]§e使用/music reload 重读配置文件"; + Next = "§d[AllMusic]§e使用/music next 强制切歌"; + Ban = "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌"; + Url = "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲"; + Delete = "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲"; + AddList = "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表"; + ClearList = "§d[AllMusic]§e使用/music clearlist 清空空闲歌单"; + Login = "§d[AllMusic]§e使用/music login [验证码] 登录账户"; + Code = "§d[AllMusic]§e使用/music code 获取短信验证码"; + } + + public static HelpAdminObj make() { + HelpAdminObj obj = new HelpAdminObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/HelpNormalObj.java b/core/objs/message/HelpNormalObj.java index 6e8fe501..59751a7e 100644 --- a/core/objs/message/HelpNormalObj.java +++ b/core/objs/message/HelpNormalObj.java @@ -15,22 +15,6 @@ public class HelpNormalObj { public String Hud4; public String Hud5; - public HelpNormalObj() { - Head = "§d[AllMusic]§2帮助手册"; - Base = "§d[AllMusic]§2使用/music [音乐ID] 来点歌"; - Stop = "§d[AllMusic]§2使用/music stop 停止播放歌曲"; - List = "§d[AllMusic]§2使用/music list 查看歌曲队列"; - Vote = "§d[AllMusic]§2使用/music vote 投票切歌"; - NoMusic = "§d[AllMusic]§2使用/music nomusic 不再参与点歌"; - Search = "§d[AllMusic]§2使用/music search [歌名] 搜索歌曲"; - Select = "§d[AllMusic]§2使用/music select [序列] 选择歌曲"; - Hud1 = "§d[AllMusic]§2使用/music hud enable [位置] 启用关闭Hud"; - Hud2 = "§d[AllMusic]§2使用/music hud [位置] [x] [y] 设置某个Hud的位置"; - Hud3 = "§d[AllMusic]§2使用/music hud picsize [尺寸] 设置图片尺寸"; - Hud4 = "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式"; - Hud5 = "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度"; - } - public boolean check() { if (Head == null) return true; @@ -58,4 +42,27 @@ public class HelpNormalObj { return true; return Hud5 == null; } + + public void init(){ + Head = "§d[AllMusic]§e帮助手册"; + Base = "§d[AllMusic]§e使用/music [音乐ID] 来点歌"; + Stop = "§d[AllMusic]§e使用/music stop 停止播放歌曲"; + List = "§d[AllMusic]§e使用/music list 查看歌曲队列"; + Vote = "§d[AllMusic]§e使用/music vote 投票切歌"; + NoMusic = "§d[AllMusic]§e使用/music nomusic 不再参与点歌"; + Search = "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲"; + Select = "§d[AllMusic]§e使用/music select [序列] 选择歌曲"; + Hud1 = "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud"; + Hud2 = "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置"; + Hud3 = "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸"; + Hud4 = "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式"; + Hud5 = "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度"; + } + + public static HelpNormalObj make() { + HelpNormalObj obj = new HelpNormalObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/HelpObj.java b/core/objs/message/HelpObj.java index f25cecc9..4dd6dc0d 100644 --- a/core/objs/message/HelpObj.java +++ b/core/objs/message/HelpObj.java @@ -4,21 +4,28 @@ public class HelpObj { public HelpNormalObj Normal; public HelpAdminObj Admin; - public HelpObj() { - Normal = new HelpNormalObj(); - Admin = new HelpAdminObj(); - } - public boolean check() { boolean save = false; - if (Normal == null) { + if (Normal == null || Normal.check()) { save = true; Normal = new HelpNormalObj(); } - if (Admin == null) { + if (Admin == null || Admin.check()) { save = true; Admin = new HelpAdminObj(); } return save; } + + public void init() { + Normal = HelpNormalObj.make(); + Admin = HelpAdminObj.make(); + } + + public static HelpObj make() { + HelpObj obj = new HelpObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/HudListObj.java b/core/objs/message/HudListObj.java index 0df96d75..0e1780ee 100644 --- a/core/objs/message/HudListObj.java +++ b/core/objs/message/HudListObj.java @@ -9,16 +9,6 @@ public class HudListObj { public String PicRoute; public String PicRouteSpeed; - public HudListObj() { - List = "待播放列表"; - Lyric = "歌词"; - Info = "歌曲信息"; - Pic = "图片"; - All = "所有位置"; - PicRoute = "图片旋转"; - PicRouteSpeed = "图片旋转速度"; - } - public boolean check() { if (List == null) return true; @@ -47,4 +37,21 @@ public class HudListObj { } return null; } + + public void init(){ + List = "待播放列表"; + Lyric = "歌词"; + Info = "歌曲信息"; + Pic = "图片"; + All = "所有位置"; + PicRoute = "图片旋转"; + PicRouteSpeed = "图片旋转速度"; + } + + public static HudListObj make() { + HudListObj obj = new HudListObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/HudObj.java b/core/objs/message/HudObj.java index 3a05de9f..94d4c59e 100644 --- a/core/objs/message/HudObj.java +++ b/core/objs/message/HudObj.java @@ -15,22 +15,6 @@ public class HudObj { public String List; public String Ktv; - public HudObj() { - State = "§d[AllMusic]§2设置信息位置:%Hud%,状态:%State%"; - Set = "§d[AllMusic]§2已设置%Hud%的坐标为%x%, %y%"; - Reset = "§d[AllMusic]§2Hud恢复至默认位置"; - NoMusic = "没有播放的音乐"; - NoList = "队列中无歌曲"; - NoLyric = "无歌词"; - PicSize = "§d[AllMusic]§2设置图片尺寸为%Size%"; - PicRotate = "§d[AllMusic]§2设置图片旋转为%State%"; - PicRotateSpeed = "§d[AllMusic]§2设置图片旋转速度为%Size%"; - Music = "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%"; - Lyric = "%Lyric%\n%Tlyric%"; - Ktv = "§e%KLyric%§f%Lyric%§r\n%Tlyric%"; - List = "播放列表里面有%Size%首歌\n%List%"; - } - public boolean check() { if (State == null) return true; @@ -58,4 +42,27 @@ public class HudObj { return true; return Ktv == null; } + + public void init(){ + State = "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%"; + Set = "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%"; + Reset = "§d[AllMusic]§eHud恢复至默认位置"; + NoMusic = "没有播放的音乐"; + NoList = "队列中无歌曲"; + NoLyric = "无歌词"; + PicSize = "§d[AllMusic]§e设置图片尺寸为%Size%"; + PicRotate = "§d[AllMusic]§e设置图片旋转为%State%"; + PicRotateSpeed = "§d[AllMusic]§e设置图片旋转速度为%Size%"; + Music = "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%"; + Lyric = "%Lyric%\n%Tlyric%"; + Ktv = "§e%KLyric%§f%Lyric%§r\n%Tlyric%"; + List = "播放列表里面有%Size%首歌\n%List%"; + } + + public static HudObj make() { + HudObj obj = new HudObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/ListMusicObj.java b/core/objs/message/ListMusicObj.java index 8eca85a8..91b50bac 100644 --- a/core/objs/message/ListMusicObj.java +++ b/core/objs/message/ListMusicObj.java @@ -5,12 +5,6 @@ public class ListMusicObj { public String Item; public String Get; - public ListMusicObj() { - Head = "§d[AllMusic]§2队列中有歌曲数:&Count&"; - Item = "§2%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%"; - Get = "§d[AllMusic]§2歌曲列表%ListName%获取成功"; - } - public boolean check() { boolean res = Head == null; if (Item == null) @@ -20,4 +14,17 @@ public class ListMusicObj { return res; } + + public void init(){ + Head = "§d[AllMusic]§e队列中有歌曲数:%Count%"; + Item = "§e%Index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%"; + Get = "§d[AllMusic]§e歌曲列表%ListName%获取成功"; + } + + public static ListMusicObj make() { + ListMusicObj obj = new ListMusicObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/LyricObj.java b/core/objs/message/LyricObj.java index e5993aca..50540f75 100644 --- a/core/objs/message/LyricObj.java +++ b/core/objs/message/LyricObj.java @@ -7,14 +7,6 @@ public class LyricObj { public String Empty2; public String Empty3; - public LyricObj() { - Data = "%Lyric%"; - TData = "%Lyric%(%TLyric%)"; - Empty1 = "没有歌词"; - Empty2 = "没有翻译歌词"; - Empty3 = "没有KTV歌词"; - } - public boolean check() { if (Data == null) return true; @@ -26,4 +18,19 @@ public class LyricObj { return true; return Empty3 == null; } + + public void init(){ + Data = "%Lyric%"; + TData = "%Lyric%(%TLyric%)"; + Empty1 = "没有歌词"; + Empty2 = "没有翻译歌词"; + Empty3 = "没有KTV歌词"; + } + + public static LyricObj make() { + LyricObj obj = new LyricObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/MessageObj.java b/core/objs/message/MessageObj.java similarity index 59% rename from core/objs/MessageObj.java rename to core/objs/message/MessageObj.java index aebc1ca2..96ec71d6 100644 --- a/core/objs/MessageObj.java +++ b/core/objs/message/MessageObj.java @@ -1,8 +1,6 @@ -package coloryr.allmusic.core.objs; +package coloryr.allmusic.core.objs.message; import coloryr.allmusic.core.AllMusic; -import coloryr.allmusic.core.objs.message.SearchObj; -import coloryr.allmusic.core.objs.message.*; public class MessageObj { public MusicPlayObj MusicPlay; @@ -22,87 +20,94 @@ public class MessageObj { public FunObj Fun; public String Version; - public MessageObj() { - MusicPlay = new MusicPlayObj(); - AddMusic = new AddMusicObj(); - Page = new PageObj(); - Lyric = new LyricObj(); - Vote = new VoteObj(); - Search = new SearchObj(); - Hud = new HudObj(); - Command = new CommandObj(); - HudList = new HudListObj(); - Custom = new CustomObj(); - PAPI = new PAPIObj(); - Cost = new CostObj(); - Click = new ClickObj(); - Help = new HelpObj(); - Fun = new FunObj(); - Version = AllMusic.configVersion; - } - public boolean check() { boolean saveConfig = false; if (MusicPlay == null || MusicPlay.check()) { saveConfig = true; - MusicPlay = new MusicPlayObj(); + MusicPlay = MusicPlayObj.make(); } if (AddMusic == null || AddMusic.check()) { saveConfig = true; - AddMusic = new AddMusicObj(); + AddMusic = AddMusicObj.make(); } if (Page == null || Page.check()) { saveConfig = true; - Page = new PageObj(); + Page = PageObj.make(); } if (Lyric == null || Lyric.check()) { saveConfig = true; - Lyric = new LyricObj(); + Lyric = LyricObj.make(); } if (Vote == null || Vote.check()) { saveConfig = true; - Vote = new VoteObj(); + Vote = VoteObj.make(); } if (Search == null || Search.check()) { saveConfig = true; - Search = new SearchObj(); + Search = SearchObj.make(); } if (Hud == null || Hud.check()) { saveConfig = true; - Hud = new HudObj(); + Hud = HudObj.make(); } if (HudList == null || HudList.check()) { saveConfig = true; - HudList = new HudListObj(); + HudList = HudListObj.make(); } if (Command == null || Command.check()) { saveConfig = true; - Command = new CommandObj(); + Command = CommandObj.make(); } if (Custom == null || Custom.check()) { saveConfig = true; - Custom = new CustomObj(); + Custom = CustomObj.make(); } if (PAPI == null || PAPI.check()) { saveConfig = true; - PAPI = new PAPIObj(); + PAPI = PAPIObj.make(); } if (Cost == null || Cost.check()) { saveConfig = true; - Cost = new CostObj(); + Cost = CostObj.make(); } if (Click == null || Click.check()) { saveConfig = true; - Click = new ClickObj(); + Click = ClickObj.make(); } if (Help == null || Help.check()) { saveConfig = true; - Help = new HelpObj(); + Help = HelpObj.make(); } if (Fun == null || Fun.check()) { saveConfig = true; - Fun = new FunObj(); + Fun = FunObj.make(); } return saveConfig; } + + public void init(){ + MusicPlay = MusicPlayObj.make(); + AddMusic = AddMusicObj.make(); + Page = PageObj.make(); + Lyric = LyricObj.make(); + Vote = VoteObj.make(); + Search = SearchObj.make(); + Hud = HudObj.make(); + Command = CommandObj.make(); + HudList = HudListObj.make(); + Custom = CustomObj.make(); + PAPI = PAPIObj.make(); + Cost = CostObj.make(); + Click = ClickObj.make(); + Help = HelpObj.make(); + Fun = FunObj.make(); + Version = AllMusic.messageVersion; + } + + public static MessageObj make() { + MessageObj obj = new MessageObj(); + obj.init(); + + return obj; + } } \ No newline at end of file diff --git a/core/objs/message/MusicPlayObj.java b/core/objs/message/MusicPlayObj.java index df34eac8..213d6da3 100644 --- a/core/objs/message/MusicPlayObj.java +++ b/core/objs/message/MusicPlayObj.java @@ -15,22 +15,6 @@ public class MusicPlayObj { public String Trail; public String Cancel; - public MusicPlayObj() { - StopPlay = "§d[AllMusic]§2已停止你的音乐播放"; - NoMusic = "§d[AllMusic]§2无正在播放的歌曲"; - Play = "§d[AllMusic]§2正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%"; - NoPlay = "§d[AllMusic]§2队列中无歌曲"; - ListMusic = new ListMusicObj(); - NoCanPlay = "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲"; - NoPlayMusic = "§d[AllMusic]§2你不会再收到点歌了!想要再次参与点歌就点一首歌吧!"; - Switch = "§d[AllMusic]§2切换到玩家歌曲"; - AddMusic = "§d[AllMusic]§2音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%"; - CheckMusic = "§d[AllMusic]§2正在解析歌曲%MusicID%"; - MusicInfo = "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%"; - Trail = "§d[AllMusic]§2该音乐为试听音乐"; - Cancel = "§d[AllMusic]§e播放被取消"; - } - public boolean check() { boolean res = StopPlay == null; if (NoMusic == null) @@ -60,4 +44,27 @@ public class MusicPlayObj { return res; } + + public void init(){ + StopPlay = "§d[AllMusic]§e已停止你的音乐播放"; + NoMusic = "§d[AllMusic]§e无正在播放的歌曲"; + Play = "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%"; + NoPlay = "§d[AllMusic]§e队列中无歌曲"; + ListMusic = ListMusicObj.make(); + NoCanPlay = "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲"; + NoPlayMusic = "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌吧!"; + Switch = "§d[AllMusic]§e切换到玩家歌曲"; + AddMusic = "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%"; + CheckMusic = "§d[AllMusic]§e正在解析歌曲%MusicID%"; + MusicInfo = "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%"; + Trail = "§d[AllMusic]§e该音乐为试听音乐"; + Cancel = "§d[AllMusic]§e播放被取消"; + } + + public static MusicPlayObj make() { + MusicPlayObj obj = new MusicPlayObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/PAPIObj.java b/core/objs/message/PAPIObj.java index db3a1975..38482749 100644 --- a/core/objs/message/PAPIObj.java +++ b/core/objs/message/PAPIObj.java @@ -3,11 +3,18 @@ package coloryr.allmusic.core.objs.message; public class PAPIObj { public String NoMusic; - public PAPIObj() { - NoMusic = "没有播放的音乐"; - } - public boolean check() { return NoMusic == null; } + + public void init(){ + NoMusic = "没有播放的音乐"; + } + + public static PAPIObj make() { + PAPIObj obj = new PAPIObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/PageObj.java b/core/objs/message/PageObj.java index c92f67d4..56139dd2 100644 --- a/core/objs/message/PageObj.java +++ b/core/objs/message/PageObj.java @@ -5,12 +5,6 @@ public class PageObj { public String Next; public String Last; - public PageObj() { - Choice = "§e[§n点我选择§r§e]§2%index%->%MusicName% | %MusicAuthor% | %MusicAl%"; - Next = "§d[AllMusic]§e[§n点我下一页§r§e]"; - Last = "§d[AllMusic]§e[§n点我上一页§r§e]"; - } - public boolean check() { boolean res = Choice == null; if (Next == null) @@ -20,4 +14,17 @@ public class PageObj { return res; } + + public void init(){ + Choice = "§e%Index%->%MusicName% | %MusicAuthor% | %MusicAl%"; + Next = "§e[§n点我下一页§r§e]"; + Last = "§e[§n点我上一页§r§e]"; + } + + public static PageObj make() { + PageObj obj = new PageObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/SearchObj.java b/core/objs/message/SearchObj.java index e821d0a9..60cf2e00 100644 --- a/core/objs/message/SearchObj.java +++ b/core/objs/message/SearchObj.java @@ -11,18 +11,6 @@ public class SearchObj { public String CantLast; public String StartSearch; - public SearchObj() { - StartSearch = "§d[AllMusic]§2正在排队搜歌"; - NoPer = "§d[AllMusic]§c你没有权限搜歌"; - CantSearch = "§d[AllMusic]§c无法搜索歌曲:%Music%"; - Res = "§d[AllMusic]§2搜索结果"; - NoSearch = "§d[AllMusic]§c你没有搜索音乐"; - ErrorNum = "§d[AllMusic]§c请输入正确的序号"; - Chose = "§d[AllMusic]§2你选择了序号%Num%"; - CantNext = "§d[AllMusic]§c无法下一页"; - CantLast = "§d[AllMusic]§c无法上一页"; - } - public boolean check() { if (NoPer == null) return true; @@ -42,4 +30,23 @@ public class SearchObj { return true; return StartSearch == null; } + + public void init(){ + StartSearch = "§d[AllMusic]§e正在排队搜歌"; + NoPer = "§d[AllMusic]§c你没有权限搜歌"; + CantSearch = "§d[AllMusic]§c无法搜索歌曲:%Music%"; + Res = "§d[AllMusic]§e搜索结果"; + NoSearch = "§d[AllMusic]§c你没有搜索音乐"; + ErrorNum = "§d[AllMusic]§c请输入正确的序号"; + Chose = "§d[AllMusic]§e你选择了序号%Num%"; + CantNext = "§d[AllMusic]§c无法下一页"; + CantLast = "§d[AllMusic]§c无法上一页"; + } + + public static SearchObj make() { + SearchObj obj = new SearchObj(); + obj.init(); + + return obj; + } } diff --git a/core/objs/message/VoteObj.java b/core/objs/message/VoteObj.java index 7a3150b2..adac2921 100644 --- a/core/objs/message/VoteObj.java +++ b/core/objs/message/VoteObj.java @@ -10,17 +10,6 @@ public class VoteObj { public String TimeOut; public String Do; - public VoteObj() { - NoPermission = "§d[AllMusic]§c你没有权限切歌"; - DoVote = "§d[AllMusic]§2已发起切歌投票"; - BQ = "§d[AllMusic]§2%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。"; - Agree = "§d[AllMusic]§2你同意切歌"; - BQAgree = "§d[AllMusic]§2%PlayerName%同意切歌,共有%Count%名玩家同意切歌。"; - ARAgree = "§d[AllMusic]§2你已申请切歌"; - TimeOut = "§d[AllMusic]§2切歌时间结束"; - Do = "§d[AllMusic]§2已切歌"; - } - public boolean check() { if (NoPermission == null) return true; @@ -38,4 +27,22 @@ public class VoteObj { return true; return Do == null; } + + public void init(){ + NoPermission = "§d[AllMusic]§c你没有权限切歌"; + DoVote = "§d[AllMusic]§e已发起切歌投票"; + BQ = "§d[AllMusic]§e%PlayerName%发起了切歌投票,%Time%秒后结束,输入/music vote 同意切歌。"; + Agree = "§d[AllMusic]§e你同意切歌"; + BQAgree = "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。"; + ARAgree = "§d[AllMusic]§e你已申请切歌"; + TimeOut = "§d[AllMusic]§e切歌时间结束"; + Do = "§d[AllMusic]§e已切歌"; + } + + public static VoteObj make() { + VoteObj obj = new VoteObj(); + obj.init(); + + return obj; + } } diff --git a/fabric_1_16_5/gradle.properties b/fabric_1_16_5/gradle.properties index 25ad540d..65bdaeef 100644 --- a/fabric_1_16_5/gradle.properties +++ b/fabric_1_16_5/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.14.14 fabric_kotlin_version=1.9.1+kotlin.1.8.10 # Mod Properties -mod_version = 2.18.8 +mod_version = 2.18.12 maven_group = coloryr.allmusic archives_base_name =[Fabric1.16.5]AllMusic_Server diff --git a/fabric_1_16_5/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java b/fabric_1_16_5/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java index 33dddda2..9ac1f03e 100644 --- a/fabric_1_16_5/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java +++ b/fabric_1_16_5/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/fabric_1_16_5/src/main/resources/config.json b/fabric_1_16_5/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/fabric_1_16_5/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/fabric_1_16_5/src/main/resources/message.json b/fabric_1_16_5/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/fabric_1_16_5/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/fabric_1_18_2/gradle.properties b/fabric_1_18_2/gradle.properties index 6fe8a592..998f4c4d 100644 --- a/fabric_1_18_2/gradle.properties +++ b/fabric_1_18_2/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.14.14 fabric_kotlin_version=1.9.1+kotlin.1.8.10 # Mod Properties -mod_version=2.18.8 +mod_version=2.18.12 maven_group=coloryr.allmusic archives_base_name=[Fabric1.18.2]AllMusic_Server diff --git a/fabric_1_18_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java b/fabric_1_18_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java index c6ad73db..81f9c7b5 100644 --- a/fabric_1_18_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java +++ b/fabric_1_18_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/fabric_1_18_2/src/main/resources/config.json b/fabric_1_18_2/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/fabric_1_18_2/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/fabric_1_18_2/src/main/resources/message.json b/fabric_1_18_2/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/fabric_1_18_2/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/fabric_1_19_2/gradle.properties b/fabric_1_19_2/gradle.properties index 4a7b6f59..919dd8aa 100644 --- a/fabric_1_19_2/gradle.properties +++ b/fabric_1_19_2/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.14.14 fabric_kotlin_version=1.9.1+kotlin.1.8.10 # Mod Properties -mod_version = 2.18.8 +mod_version = 2.18.12 maven_group = coloryr.allmusic archives_base_name =[Fabric1.19.2]AllMusic_Server diff --git a/fabric_1_19_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java b/fabric_1_19_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java index ea3ed138..2b9a0a66 100644 --- a/fabric_1_19_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java +++ b/fabric_1_19_2/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/fabric_1_19_3/gradle.properties b/fabric_1_19_3/gradle.properties index 611aa4c9..2d299ed1 100644 --- a/fabric_1_19_3/gradle.properties +++ b/fabric_1_19_3/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.19.3+build.5 loader_version=0.14.14 # Mod Properties -mod_version = 2.18.8 +mod_version = 2.18.12 maven_group = coloryr.allmusic archives_base_name =[Fabric1.19.3]AllMusic_Server diff --git a/fabric_1_19_3/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java b/fabric_1_19_3/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java index ea3ed138..2b9a0a66 100644 --- a/fabric_1_19_3/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java +++ b/fabric_1_19_3/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/fabric_1_20/gradle.properties b/fabric_1_20/gradle.properties index 74fb5ab2..8f31719d 100644 --- a/fabric_1_20/gradle.properties +++ b/fabric_1_20/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20+build.1 loader_version=0.14.21 # Mod Properties -mod_version = 2.18.8 +mod_version = 2.18.12 maven_group = coloryr.allmusic archives_base_name =[Fabric1.20]AllMusic_Server diff --git a/fabric_1_20/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java b/fabric_1_20/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java index ea3ed138..2b9a0a66 100644 --- a/fabric_1_20/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java +++ b/fabric_1_20/src/main/java/coloryr/allmusic/side/fabric/SideFabric.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/folia/build.gradle b/folia/build.gradle index 922df16f..f643f9f3 100644 --- a/folia/build.gradle +++ b/folia/build.gradle @@ -3,7 +3,7 @@ plugins { id 'maven-publish' id 'com.github.johnrengelman.shadow' version '7.1.2' } -version = "2.18.11" +version = "2.18.12" repositories { mavenCentral() diff --git a/folia/src/main/java/coloryr/allmusic/side/folia/SideFolia.java b/folia/src/main/java/coloryr/allmusic/side/folia/SideFolia.java index 8e08dde6..e07baa57 100644 --- a/folia/src/main/java/coloryr/allmusic/side/folia/SideFolia.java +++ b/folia/src/main/java/coloryr/allmusic/side/folia/SideFolia.java @@ -3,7 +3,7 @@ package coloryr.allmusic.side.folia; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.AllMusicFolia; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; @@ -21,7 +21,6 @@ import org.bukkit.entity.Player; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; -import java.util.function.Consumer; public class SideFolia extends ISide { private static Class ByteBufC; diff --git a/folia/src/main/resources/config.json b/folia/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/folia/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/folia/src/main/resources/message.json b/folia/src/main/resources/message.json deleted file mode 100644 index dc41e64d..00000000 --- a/folia/src/main/resources/message.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)", - "Empty1": "没有歌词", - "Empty2": "没有翻译歌词", - "Empty3": "没有KTV歌词" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "104" -} \ No newline at end of file diff --git a/forge_1_16_5/build.gradle b/forge_1_16_5/build.gradle index ca9d60b1..325aaa59 100644 --- a/forge_1_16_5/build.gradle +++ b/forge_1_16_5/build.gradle @@ -5,6 +5,7 @@ buildscript { } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0" } } @@ -16,8 +17,9 @@ apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' +apply plugin: 'kotlin' -version = '2.18.8' +version = '2.18.12' group = 'coloryr.allmusic' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = '[Forge1.16.5]AllMusic_Server' @@ -119,6 +121,13 @@ minecraft { } } +repositories { + maven { + name = 'kotlinforforge' + url = 'https://thedarkcolour.github.io/KotlinForForge/' + } +} + // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } @@ -128,8 +137,10 @@ dependencies { // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.16.5-36.2.39' + implementation 'thedarkcolour:kotlinforforge:1.16.0' + shadow 'com.squareup.okhttp3:okhttp:4.10.0' - shadow 'org.xerial:sqlite-jdbc:3.39.3.0' + shadow 'org.xerial:sqlite-jdbc:3.42.0.0' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" @@ -159,10 +170,11 @@ shadowJar { // relocate 'org.jetbrains', 'coloryr.allmusic.lib.org.jetbrains' configurations = [project.configurations.shadow] archiveClassifier.set('') -// dependencies { -// include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) -// include(dependency('org.xerial:sqlite-jdbc:3.39.3.0')) -// } + dependencies { + include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) + include(dependency('com.squareup.okio:okio-jvm:3.0.0')) + include(dependency('org.xerial:sqlite-jdbc:3.42.0.0')) + } } // Example for how to get properties into the manifest for reading by the runtime.. diff --git a/forge_1_16_5/src/main/java/coloryr/allmusic/side/forge/SideForge.java b/forge_1_16_5/src/main/java/coloryr/allmusic/side/forge/SideForge.java index 6f4bdff9..ac000635 100644 --- a/forge_1_16_5/src/main/java/coloryr/allmusic/side/forge/SideForge.java +++ b/forge_1_16_5/src/main/java/coloryr/allmusic/side/forge/SideForge.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/forge_1_16_5/src/main/resources/META-INF/mods.toml b/forge_1_16_5/src/main/resources/META-INF/mods.toml index 75eb010a..b143216e 100644 --- a/forge_1_16_5/src/main/resources/META-INF/mods.toml +++ b/forge_1_16_5/src/main/resources/META-INF/mods.toml @@ -56,3 +56,10 @@ AllMusic Server Mod versionRange="[1.16.5,1.17)" ordering="NONE" side="SERVER" +[[dependencies.allmusic_server]] + modId="kotlinforforge" + mandatory=true +# This version range declares a minimum of the current minecraft version up to but not including the next major version + versionRange="[1,)" + ordering="NONE" + side="BOTH" diff --git a/forge_1_16_5/src/main/resources/config.json b/forge_1_16_5/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/forge_1_16_5/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_16_5/src/main/resources/message.json b/forge_1_16_5/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/forge_1_16_5/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_18_2/build.gradle b/forge_1_18_2/build.gradle index 349a46c9..d8ec6806 100644 --- a/forge_1_18_2/build.gradle +++ b/forge_1_18_2/build.gradle @@ -13,11 +13,13 @@ plugins { id 'eclipse' id 'maven-publish' id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'org.jetbrains.kotlin.jvm' version '1.8.21' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21' } apply plugin: 'net.minecraftforge.gradle' -version = '2.18.8' +version = '2.18.12' group = 'coloryr.allmusic' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = '[Forge1.18.2]AllMusic_Server' @@ -142,6 +144,11 @@ repositories { // Put repositories for dependencies here // ForgeGradle automatically adds the Forge maven and Maven Central for you + maven { + name = 'Kotlin for Forge' + url = 'https://thedarkcolour.github.io/KotlinForForge/' + } + // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: // flatDir { // dir 'libs' @@ -154,8 +161,10 @@ dependencies { // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.18.2-40.2.1' + implementation 'thedarkcolour:kotlinforforge:3.12.0' + shadow 'com.squareup.okhttp3:okhttp:4.10.0' - shadow 'org.xerial:sqlite-jdbc:3.39.3.0' + shadow 'org.xerial:sqlite-jdbc:3.42.0.0' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency @@ -178,10 +187,11 @@ shadowJar { // relocate 'org.jetbrains', 'coloryr.allmusic.lib.org.jetbrains' configurations = [project.configurations.shadow] archiveClassifier.set('') -// dependencies { -// include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) -// include(dependency('org.xerial:sqlite-jdbc:3.39.3.0')) -// } + dependencies { + include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) + include(dependency('com.squareup.okio:okio-jvm:3.0.0')) + include(dependency('org.xerial:sqlite-jdbc:3.42.0.0')) + } } // Example for how to get properties into the manifest for reading at runtime. diff --git a/forge_1_18_2/src/main/java/coloryr/allmusic/side/forge/SideForge.java b/forge_1_18_2/src/main/java/coloryr/allmusic/side/forge/SideForge.java index b0e23d46..f9c1844f 100644 --- a/forge_1_18_2/src/main/java/coloryr/allmusic/side/forge/SideForge.java +++ b/forge_1_18_2/src/main/java/coloryr/allmusic/side/forge/SideForge.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/forge_1_18_2/src/main/resources/META-INF/mods.toml b/forge_1_18_2/src/main/resources/META-INF/mods.toml index b381c4e8..12f0a2ff 100644 --- a/forge_1_18_2/src/main/resources/META-INF/mods.toml +++ b/forge_1_18_2/src/main/resources/META-INF/mods.toml @@ -56,3 +56,11 @@ AllMusic Server Mod versionRange="[1.18.2,1.19)" ordering="NONE" side="SERVER" +[[dependencies.allmusic_server]] + modId="kotlinforforge" + mandatory=true +# This version range declares a minimum of the current minecraft version up to but not including the next major version + versionRange="[3,)" + ordering="NONE" + side="BOTH" + diff --git a/forge_1_18_2/src/main/resources/config.json b/forge_1_18_2/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/forge_1_18_2/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_18_2/src/main/resources/message.json b/forge_1_18_2/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/forge_1_18_2/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_19_2/build.gradle b/forge_1_19_2/build.gradle index 85744609..939890e2 100644 --- a/forge_1_19_2/build.gradle +++ b/forge_1_19_2/build.gradle @@ -7,7 +7,7 @@ plugins { id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21' } -version = '2.18.9' +version = '2.18.12' group = 'coloryr.allmusic' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = '[Forge1.19.2]AllMusic_Server' @@ -146,7 +146,7 @@ dependencies { implementation 'thedarkcolour:kotlinforforge:3.12.0' shadow 'com.squareup.okhttp3:okhttp:4.10.0' - shadow 'org.xerial:sqlite-jdbc:3.39.3.0' + shadow 'org.xerial:sqlite-jdbc:3.42.0.0' // implementation 'com.squareup.okhttp3:okhttp:4.10.0' // implementation 'org.xerial:sqlite-jdbc:3.39.3.0' @@ -172,7 +172,8 @@ shadowJar { archiveClassifier.set('') dependencies { include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) - include(dependency('org.xerial:sqlite-jdbc:3.39.3.0')) + include(dependency('com.squareup.okio:okio-jvm:3.0.0')) + include(dependency('org.xerial:sqlite-jdbc:3.42.0.0')) } } diff --git a/forge_1_19_2/src/main/resources/config.json b/forge_1_19_2/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/forge_1_19_2/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_19_2/src/main/resources/message.json b/forge_1_19_2/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/forge_1_19_2/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_19_3/build.gradle b/forge_1_19_3/build.gradle index 7c56912b..4dac5b0c 100644 --- a/forge_1_19_3/build.gradle +++ b/forge_1_19_3/build.gradle @@ -3,9 +3,11 @@ plugins { id 'maven-publish' id 'net.minecraftforge.gradle' version '5.1.+' id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'org.jetbrains.kotlin.jvm' version '1.9.0' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.0' } -version = '2.18.8' +version = '2.18.12' group = 'coloryr.allmusic' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = '[Forge1.19.3]AllMusic_Server' @@ -126,7 +128,8 @@ repositories { // } maven { - url 'https://jitpack.io' + name = 'Kotlin for Forge' + url = 'https://thedarkcolour.github.io/KotlinForForge/' } } @@ -136,8 +139,10 @@ dependencies { // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.19.3-44.1.20' + implementation 'thedarkcolour:kotlinforforge:4.4.0' + shadow 'com.squareup.okhttp3:okhttp:4.10.0' - shadow 'org.xerial:sqlite-jdbc:3.39.3.0' + shadow 'org.xerial:sqlite-jdbc:3.42.0.0' // implementation 'com.squareup.okhttp3:okhttp:4.10.0' // implementation 'org.xerial:sqlite-jdbc:3.39.3.0' @@ -161,10 +166,11 @@ shadowJar { // relocate 'org.jetbrains', 'coloryr.allmusic.lib.org.jetbrains' configurations = [project.configurations.shadow] archiveClassifier.set('') -// dependencies { -// include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) -// include(dependency('org.xerial:sqlite-jdbc:3.39.3.0')) -// } + dependencies { + include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) + include(dependency('com.squareup.okio:okio-jvm:3.0.0')) + include(dependency('org.xerial:sqlite-jdbc:3.42.0.0')) + } } // Example for how to get properties into the manifest for reading at runtime. diff --git a/forge_1_19_3/gradle/wrapper/gradle-wrapper.properties b/forge_1_19_3/gradle/wrapper/gradle-wrapper.properties index ae04661e..070cb702 100644 --- a/forge_1_19_3/gradle/wrapper/gradle-wrapper.properties +++ b/forge_1_19_3/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/forge_1_19_3/src/main/java/coloryr/allmusic/side/forge/SideForge.java b/forge_1_19_3/src/main/java/coloryr/allmusic/side/forge/SideForge.java index 79091ef8..66ac770d 100644 --- a/forge_1_19_3/src/main/java/coloryr/allmusic/side/forge/SideForge.java +++ b/forge_1_19_3/src/main/java/coloryr/allmusic/side/forge/SideForge.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/forge_1_20/build.gradle b/forge_1_20/build.gradle index 63536ac1..a66421b5 100644 --- a/forge_1_20/build.gradle +++ b/forge_1_20/build.gradle @@ -4,6 +4,8 @@ plugins { id 'maven-publish' id 'net.minecraftforge.gradle' version '5.+' id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'org.jetbrains.kotlin.jvm' version '1.8.22' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.22' } apply plugin: 'com.github.johnrengelman.shadow' @@ -157,7 +159,8 @@ repositories { // } maven { - url 'https://jitpack.io' + name = 'Kotlin for Forge' + url = 'https://thedarkcolour.github.io/KotlinForForge/' } } @@ -175,8 +178,10 @@ dependencies { // compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}") // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}") + implementation "thedarkcolour:kotlinforforge:$kff_version" + shadow 'com.squareup.okhttp3:okhttp:4.10.0' - shadow 'org.xerial:sqlite-jdbc:3.39.3.0' + shadow 'org.xerial:sqlite-jdbc:3.42.0.0' // Example mod dependency using a mod jar from ./libs with a flat dir repository // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar @@ -256,10 +261,11 @@ shadowJar { // relocate 'org.jetbrains', 'coloryr.allmusic.lib.org.jetbrains' configurations = [project.configurations.shadow] archiveClassifier.set('') -// dependencies { -// include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) -// include(dependency('org.xerial:sqlite-jdbc:3.39.3.0')) -// } + dependencies { + include(dependency('com.squareup.okhttp3:okhttp:4.10.0')) + include(dependency('com.squareup.okio:okio-jvm:3.0.0')) + include(dependency('org.xerial:sqlite-jdbc:3.42.0.0')) + } } reobf { diff --git a/forge_1_20/gradle.properties b/forge_1_20/gradle.properties index e528bace..a6826c93 100644 --- a/forge_1_20/gradle.properties +++ b/forge_1_20/gradle.properties @@ -48,7 +48,7 @@ mod_name=AllMusic_Server # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=All Rights Reserved # The mod version. See https://semver.org/ -mod_version=2.18.10 +mod_version=2.18.12 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -56,4 +56,6 @@ mod_group_id=coloryr.allmusic_server # The authors of the mod. This is a simple text string that is used for display purposes in the mod list. mod_authors=Coloryr # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. -mod_description=AllMusic \ No newline at end of file +mod_description=AllMusic + +kff_version=4.3.0 \ No newline at end of file diff --git a/forge_1_20/src/main/java/coloryr/allmusic/side/forge/SideForge.java b/forge_1_20/src/main/java/coloryr/allmusic/side/forge/SideForge.java index 79091ef8..66ac770d 100644 --- a/forge_1_20/src/main/java/coloryr/allmusic/side/forge/SideForge.java +++ b/forge_1_20/src/main/java/coloryr/allmusic/side/forge/SideForge.java @@ -5,7 +5,7 @@ import coloryr.allmusic.TaskItem; import coloryr.allmusic.Tasks; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/forge_1_20/src/main/resources/META-INF/mods.toml b/forge_1_20/src/main/resources/META-INF/mods.toml index 8cf3e73f..b119e9a6 100644 --- a/forge_1_20/src/main/resources/META-INF/mods.toml +++ b/forge_1_20/src/main/resources/META-INF/mods.toml @@ -62,3 +62,10 @@ mandatory=true versionRange="${minecraft_version_range}" ordering="NONE" side="BOTH" +[[dependencies.${mod_id}]] +modId="kotlinforforge" +mandatory=true +# This version range declares a minimum of the current minecraft version up to but not including the next major version +versionRange="[4,)" +ordering="NONE" +side="BOTH" diff --git a/forge_1_20/src/main/resources/config.json b/forge_1_20/src/main/resources/config.json deleted file mode 100644 index ec568863..00000000 --- a/forge_1_20/src/main/resources/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/forge_1_20/src/main/resources/message.json b/forge_1_20/src/main/resources/message.json deleted file mode 100644 index 6a435a90..00000000 --- a/forge_1_20/src/main/resources/message.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "103" -} \ No newline at end of file diff --git a/link.cmd b/link.cmd index cd8824ba..a88d758b 100644 --- a/link.cmd +++ b/link.cmd @@ -12,19 +12,19 @@ mklink /j "fabric_1_19_2/src/main/java/coloryr/allmusic/core" "core" mklink /j "fabric_1_18_2/src/main/java/coloryr/allmusic/core" "core" mklink /j "fabric_1_16_5/src/main/java/coloryr/allmusic/core" "core" -mklink /j "folia/src/main/resources/core" "resources" -mklink /j "server_top/src/main/resources/core" "resources" -mklink /j "server/src/main/resources/core" "resources" -mklink /j "forge_1_20/src/main/resources/core" "resources" -mklink /j "forge_1_19_3/src/main/resources/core" "resources" -mklink /j "forge_1_19_2/src/main/resources/core" "resources" -mklink /j "forge_1_18_2/src/main/resources/core" "resources" -mklink /j "forge_1_16_5/src/main/resources/core" "resources" -mklink /j "fabric_1_20/src/main/resources/core" "resources" -mklink /j "fabric_1_19_3/src/main/resources/core" "resources" -mklink /j "fabric_1_19_2/src/main/resources/core" "resources" -mklink /j "fabric_1_18_2/src/main/resources/core" "resources" -mklink /j "fabric_1_16_5/src/main/resources/core" "resources" +@REM mklink /j "folia/src/main/resources/core" "resources" +@REM mklink /j "server_top/src/main/resources/core" "resources" +@REM mklink /j "server/src/main/resources/core" "resources" +@REM mklink /j "forge_1_20/src/main/resources/core" "resources" +@REM mklink /j "forge_1_19_3/src/main/resources/core" "resources" +@REM mklink /j "forge_1_19_2/src/main/resources/core" "resources" +@REM mklink /j "forge_1_18_2/src/main/resources/core" "resources" +@REM mklink /j "forge_1_16_5/src/main/resources/core" "resources" +@REM mklink /j "fabric_1_20/src/main/resources/core" "resources" +@REM mklink /j "fabric_1_19_3/src/main/resources/core" "resources" +@REM mklink /j "fabric_1_19_2/src/main/resources/core" "resources" +@REM mklink /j "fabric_1_18_2/src/main/resources/core" "resources" +@REM mklink /j "fabric_1_16_5/src/main/resources/core" "resources" mklink /j "folia/build" "build" mklink /j "server_top/build" "build" diff --git a/remove.cmd b/remove.cmd index 35a337af..fb957bda 100644 --- a/remove.cmd +++ b/remove.cmd @@ -12,19 +12,19 @@ rmdir "fabric_1_19_2/src/main/java/coloryr/allmusic/core" rmdir "fabric_1_18_2/src/main/java/coloryr/allmusic/core" rmdir "fabric_1_16_5/src/main/java/coloryr/allmusic/core" -rmdir /s /q "folia/src/main/resources/core" -rmdir /s /q "server/src/main/resources/core" -rmdir /s /q "server_top/src/main/resources/core" -rmdir /s /q "forge_1_20/src/main/resources/core" -rmdir /s /q "forge_1_19_3/src/main/resources/core" -rmdir /s /q "forge_1_19_2/src/main/resources/core" -rmdir /s /q "forge_1_18_2/src/main/resources/core" -rmdir /s /q "forge_1_16_5/src/main/resources/core" -rmdir /s /q "fabric_1_20/src/main/resources/core" -rmdir /s /q "fabric_1_19_3/src/main/resources/core" -rmdir /s /q "fabric_1_19_2/src/main/resources/core" -rmdir /s /q "fabric_1_18_2/src/main/resources/core" -rmdir /s /q "fabric_1_16_5/src/main/resources/core" +@REM rmdir /s /q "folia/src/main/resources/core" +@REM rmdir /s /q "server/src/main/resources/core" +@REM rmdir /s /q "server_top/src/main/resources/core" +@REM rmdir /s /q "forge_1_20/src/main/resources/core" +@REM rmdir /s /q "forge_1_19_3/src/main/resources/core" +@REM rmdir /s /q "forge_1_19_2/src/main/resources/core" +@REM rmdir /s /q "forge_1_18_2/src/main/resources/core" +@REM rmdir /s /q "forge_1_16_5/src/main/resources/core" +@REM rmdir /s /q "fabric_1_20/src/main/resources/core" +@REM rmdir /s /q "fabric_1_19_3/src/main/resources/core" +@REM rmdir /s /q "fabric_1_19_2/src/main/resources/core" +@REM rmdir /s /q "fabric_1_18_2/src/main/resources/core" +@REM rmdir /s /q "fabric_1_16_5/src/main/resources/core" rmdir /s /q "folia/build" rmdir /s /q "server/build" diff --git a/resources/config.json b/resources/config.json index ec568863..5ddcaea5 100644 --- a/resources/config.json +++ b/resources/config.json @@ -1,6 +1,7 @@ { "MaxList": 10, "MinVote": 3, + "VoteTime" : 30, "Delay": 0, "KDelay": 0, "Admin": ["CONSOLE","Color_yr"], @@ -58,5 +59,5 @@ "Rain": true, "RainRate": 10 }, - "Version": "103" + "Version": "104" } \ No newline at end of file diff --git a/resources/message.json b/resources/message.json index dc41e64d..5017cc3f 100644 --- a/resources/message.json +++ b/resources/message.json @@ -5,8 +5,8 @@ "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", "NoPlay": "§d[AllMusic]§e队列中无歌曲", "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", + "Head": "§d[AllMusic]§e队列中有歌曲数:%Count%", + "Item": "§e%Index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" }, "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", @@ -29,7 +29,7 @@ "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" }, "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", + "Choice": "§e%Index%->%MusicName% | %MusicAuthor% | %MusicAl%", "Next": "§e[§n点我下一页§r§e]", "Last": "§e[§n点我上一页§r§e]" }, @@ -69,8 +69,8 @@ "NoList": "队列中无歌曲", "NoLyric": "无歌词", "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", + "PicRotate": "§d[AllMusic]§e设置图片旋转为%State%", + "PicRotateSpeed": "§d[AllMusic]§e设置图片旋转速度为%Size%", "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", "Lyric": "%Lyric%\n%Tlyric%", "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", @@ -129,11 +129,12 @@ "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" + "Login": "§d[AllMusic]§e使用/music login [验证码] 登录账户", + "Code": "§d[AllMusic]§e使用/music code 获取短信验证码" } }, "Fun": { "Rain": "§d[AllMusic]§e天空开始变得湿润" }, - "Version": "104" + "Version": "105" } \ No newline at end of file diff --git a/server/src/main/java/coloryr/allmusic/side/bukkit/SideBukkit.java b/server/src/main/java/coloryr/allmusic/side/bukkit/SideBukkit.java index 9282a76c..09c8b255 100644 --- a/server/src/main/java/coloryr/allmusic/side/bukkit/SideBukkit.java +++ b/server/src/main/java/coloryr/allmusic/side/bukkit/SideBukkit.java @@ -3,7 +3,7 @@ package coloryr.allmusic.side.bukkit; import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.AllMusicBukkit; import coloryr.allmusic.core.hud.HudUtils; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/server/src/main/resources/plugin.yml b/server/src/main/resources/plugin.yml index 1f712b00..27f9c94b 100644 --- a/server/src/main/resources/plugin.yml +++ b/server/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: AllMusic main: coloryr.allmusic.AllMusicBukkit author: Color_yr -version: 2.18.0 +version: 2.18.12 softdepend: [PlaceholderAPI, Vault, Essentials, CMI] api-version: 1.13 diff --git a/server_top/build.gradle b/server_top/build.gradle index 5263abbe..d7e8eba5 100644 --- a/server_top/build.gradle +++ b/server_top/build.gradle @@ -3,7 +3,7 @@ plugins { id 'maven-publish' id 'com.github.johnrengelman.shadow' version '6.1.0' } -version = "2.18.10" +version = "2.18.12" repositories { mavenCentral() diff --git a/server_top/src/main/java/coloryr/allmusic/side/bc/SideBC.java b/server_top/src/main/java/coloryr/allmusic/side/bc/SideBC.java index d005b190..4642a900 100644 --- a/server_top/src/main/java/coloryr/allmusic/side/bc/SideBC.java +++ b/server_top/src/main/java/coloryr/allmusic/side/bc/SideBC.java @@ -4,7 +4,7 @@ import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.AllMusicBC; import coloryr.allmusic.core.hud.HudUtils; import coloryr.allmusic.core.music.play.PlayMusic; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/server_top/src/main/java/coloryr/allmusic/side/velocity/SideVelocity.java b/server_top/src/main/java/coloryr/allmusic/side/velocity/SideVelocity.java index ff29aa5b..bdbe504e 100644 --- a/server_top/src/main/java/coloryr/allmusic/side/velocity/SideVelocity.java +++ b/server_top/src/main/java/coloryr/allmusic/side/velocity/SideVelocity.java @@ -4,7 +4,7 @@ import coloryr.allmusic.core.AllMusic; import coloryr.allmusic.AllMusicVelocity; import coloryr.allmusic.core.hud.HudUtils; import coloryr.allmusic.core.music.play.PlayMusic; -import coloryr.allmusic.core.objs.hud.SaveObj; +import coloryr.allmusic.core.objs.config.SaveObj; import coloryr.allmusic.core.objs.music.MusicObj; import coloryr.allmusic.core.objs.music.SongInfoObj; import coloryr.allmusic.core.side.ComType; diff --git a/server_top/src/main/resources/bungee.yml b/server_top/src/main/resources/bungee.yml index 0880a293..109be1b0 100644 --- a/server_top/src/main/resources/bungee.yml +++ b/server_top/src/main/resources/bungee.yml @@ -1,4 +1,4 @@ name: AllMusic main: coloryr.allmusic.AllMusicBC author: Color_yr -version: 2.18.0 +version: 2.18.12 diff --git a/server_top/src/main/resources/config.json b/server_top/src/main/resources/config.json deleted file mode 100644 index cc0cfb34..00000000 --- a/server_top/src/main/resources/config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "MaxList": 10, - "MinVote": 3, - "Delay": 0, - "KDelay": 0, - "Admin": ["CONSOLE","Color_yr"], - "LoginUser": "", - "NoMusicServer": [], - "NoMusicPlayer": [], - "BanMusic": [], - "PlayList": [], - "PlayListSwitch": true, - "PlayListRandom": true, - "SendLyric": true, - "NeedPermission": false, - "DefaultAddMusic": 0, - "TopPAPI": false, - "MessageLimit": false, - "MessageLimitSize": 40, - "MutePlayMessage": false, - "MuteAddMessage": false, - "ShowInBar": false, - "DefaultHud": { - "List": { - "x": 2, - "y": 74 - }, - "Lyric": { - "x": 74, - "y": 53 - }, - "Info": { - "x": 74, - "y": 2 - }, - "Pic": { - "x": 2, - "y": 2 - }, - "PicRotateSpeed": 10, - "EnablePicRotate": true, - "EnableList": true, - "EnableLyric": true, - "EnableInfo": true, - "EnablePic": true - }, - "Economys": { - "MysqlUrl": "jdbc:mysql://localhost:3306/minecraft?autoReconnect=true&autoReconnectForPools=true", - "Vault": true, - "TopVault": true, - "Backend": "Server1" - }, - "UseCost": false, - "SearchCost": 20, - "AddMusicCost": 10, - "MaxMusicTime": 600, - "KtvMode": true, - "MusicBR": "320000", - "FunConfig": { - "Rain": true, - "RainRate": 10 - }, - "Version": "103" -} \ No newline at end of file diff --git a/server_top/src/main/resources/message.json b/server_top/src/main/resources/message.json deleted file mode 100644 index dc41e64d..00000000 --- a/server_top/src/main/resources/message.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "MusicPlay": { - "StopPlay": "§d[AllMusic]§e已停止你的音乐播放", - "NoMusic": "§d[AllMusic]§e无正在播放的歌曲", - "Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "NoPlay": "§d[AllMusic]§e队列中无歌曲", - "ListMusic": { - "Head": "§d[AllMusic]§e队列中有歌曲数:&Count&", - "Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功" - }, - "NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲", - "NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!", - "Switch": "§d[AllMusic]§e切换到玩家歌曲", - "AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%", - "CheckMusic": "§d[AllMusic]§2正在解析歌曲%MusicID%", - "MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%", - "Trail": "§d[AllMusic]§e该音乐为试听音乐", - "Cancel": "§d[AllMusic]§e播放被取消" - }, - "AddMusic": { - "ListFull": "§d[AllMusic]§c错误,队列已满", - "BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了", - "ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了", - "Success": "§d[AllMusic]§e点歌成功", - "NoPlayer": "§d[AllMusic]§c没有播放的玩家", - "NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID", - "Cancel": "§d[AllMusic]§e点歌被取消", - "TimeOut": "§d[AllMusic]§e点歌被取消,音乐长度过长" - }, - "Page": { - "Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%", - "Next": "§e[§n点我下一页§r§e]", - "Last": "§e[§n点我上一页§r§e]" - }, - "Lyric": { - "Data": "%Lyric%", - "TData": "%Lyric%(%TLyric%)", - "Empty1": "没有歌词", - "Empty2": "没有翻译歌词", - "Empty3": "没有KTV歌词" - }, - "Vote": { - "NoPermission": "§d[AllMusic]§c你没有权限切歌", - "DoVote": "§d[AllMusic]§e已发起切歌投票", - "BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。", - "Agree": "§d[AllMusic]§e你同意切歌", - "BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。", - "ARAgree": "§d[AllMusic]§e你已申请切歌", - "TimeOut": "§d[AllMusic]§e切歌时间结束", - "Do": "§d[AllMusic]§e已切歌" - }, - "Search": { - "StartSearch": "§d[AllMusic]§e正在排队搜歌", - "NoPer": "§d[AllMusic]§c你没有权限搜歌", - "CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%", - "Res": "§d[AllMusic]§e搜索结果", - "NoSearch": "§d[AllMusic]§c你没有搜索音乐", - "ErrorNum": "§d[AllMusic]§c请输入正确的序号", - "Chose": "§d[AllMusic]§e你选择了序号%Num%", - "CantNext": "§d[AllMusic]§c无法下一页", - "CantLast": "§d[AllMusic]§c无法上一页" - }, - "Hud": { - "State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%", - "Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%", - "Reset": "§d[AllMusic]§eHud恢复至默认位置", - "NoMusic": "没有播放的音乐", - "NoList": "队列中无歌曲", - "NoLyric": "无歌词", - "PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%", - "PicRotate": "§d[AllMusic]§2设置图片旋转为%State%", - "PicRotateSpeed": "§d[AllMusic]§2设置图片旋转速度为%Size%", - "Music": "%Name% %AllTime%/%NowTime%\n%Author%\n%Alia%\n%Al%\nby: %Player%", - "Lyric": "%Lyric%\n%Tlyric%", - "Ktv": "§e%KLyric%§f%Lyric%§r\n%Tlyric%", - "List": "播放列表里面有%Size%首歌\n%List%" - }, - "Command": { - "Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助", - "NoPer": "§d[AllMusic]§c你没有权限点歌" - }, - "HudList": { - "List": "待播放列表", - "Lyric": "歌词", - "Info": "歌曲信息", - "Pic": "图片", - "All": "所有位置", - "PicRoute": "图片旋转", - "PicRouteSpeed": "图片旋转速度" - }, - "Custom": { - "Info": "自定义音乐" - }, - "PAPI": { - "NoMusic": "没有播放的音乐" - }, - "Cost": { - "Search": "§d[AllMusic]§e你搜歌花费了%Cost%", - "AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%", - "NoMoney": "§d[AllMusic]§c你没有足够的钱", - "CostFail": "§d[ALLMusic]§c扣钱过程中错误" - }, - "Click": { - "This": "§b[§n点我选择§r§b]", - "Check": "§b[§n点我查看§r§b]" - }, - "Help": { - "Normal": { - "Head": "§d[AllMusic]§e帮助手册", - "Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌", - "Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲", - "List": "§d[AllMusic]§e使用/music list 查看歌曲队列", - "Vote": "§d[AllMusic]§e使用/music vote 投票切歌", - "NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌", - "Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲", - "Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲", - "Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud", - "Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置", - "Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸", - "Hud4": "§d[AllMusic]§e使用/music hud picrotate [开关] 设置图片旋转模式", - "Hud5": "§d[AllMusic]§e使用/music hud picrotatespeed [数值] 设置图片旋转速度" - }, - "Admin": { - "Reload": "§d[AllMusic]§e使用/music reload 重读配置文件", - "Next": "§d[AllMusic]§e使用/music next 强制切歌", - "Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌", - "Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲", - "Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲", - "AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表", - "ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单", - "Login": "§d[AllMusic]§e使用/music login 重新登录账户" - } - }, - "Fun": { - "Rain": "§d[AllMusic]§e天空开始变得湿润" - }, - "Version": "104" -} \ No newline at end of file