强制配置文件检查

This commit is contained in:
Color_yr committed 2022-02-01 21:33:06 +08:00
1 parent e865a2c095
commit 6bac6d6bf2
20 files changed
+262 -20

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
version = "2.14.6"
version = "2.14.7"
repositories {
mavenCentral()
+1 -1
View File
@@ -26,7 +26,7 @@ import java.util.Map;
public class AllMusic {
public static final String channel = "allmusic:channel";
public static final String version = "2.14.5";
public static final String version = "2.14.7";
private static final Map<String, SearchPage> searchSave = new HashMap<>();
private static final List<String> votePlayer = new ArrayList<>();
@@ -17,6 +17,23 @@ public class AddMusicOBJ {
NoID = "§d[AllMusic]§c错误,请输入歌曲数字ID";
}
public boolean check() {
if (ListFull == null)
return true;
if (BanMusic == null)
return true;
if (ExistMusic == null)
return true;
if (Success == null)
return true;
if (NoPlayer == null)
return true;
if (NoID == null)
return true;
return false;
}
public String getNoID() {
return NoID;
}
@@ -8,4 +8,13 @@ public class ClickObj {
This = "§b[§n点我选择§r§b]";
Check = "§b[§n点我查看§r§b]";
}
public boolean check(){
if(This == null)
return true;
if(Check == null)
return true;
return false;
}
}
@@ -9,6 +9,15 @@ public class CommandOBJ {
NoPer = "§d[AllMusic]§c你没有权限点歌";
}
public boolean check(){
if(Error == null)
return true;
if(NoPer == null)
return true;
return false;
}
public String getNoPer() {
return NoPer;
}
@@ -11,6 +11,17 @@ public class CostObj {
NoMoney = "§d[ALLMusic]§c你没有足够的钱";
}
public boolean check(){
if(Search == null)
return true;
if(AddMusic == null)
return true;
if(NoMoney == null)
return true;
return false;
}
public String getNoMoney() {
return NoMoney;
}
@@ -7,6 +7,13 @@ public class CustomOBJ {
Info = "自定义音乐";
}
public boolean check(){
if(Info == null)
return true;
return false;
}
public String getInfo() {
return Info;
}
@@ -21,6 +21,27 @@ public class HelpAdminObj {
Login = "§d[AllMusic]§2使用/music login 重新登录账户";
}
public boolean check() {
if (Reload == null)
return true;
if (Next == null)
return true;
if (Ban == null)
return true;
if (Url == null)
return true;
if (Delete == null)
return true;
if (AddList == null)
return true;
if (ClearList == null)
return true;
if (Login == null)
return true;
return false;
}
public String getLogin() {
return Login;
}
@@ -25,6 +25,31 @@ public class HelpNormalObj {
Hud2 = "§d[AllMusic]§2使用/music hud [位置] [x] [y] 设置某个Hud的位置";
}
public boolean check(){
if(Head == null)
return true;
if(Base == null)
return true;
if(Stop == null)
return true;
if(List == null)
return true;
if(Vote == null)
return true;
if(NoMusic == null)
return true;
if(Search == null)
return true;
if(Select == null)
return true;
if(Hud1 == null)
return true;
if(Hud2 == null)
return true;
return false;
}
public String getBase() {
return Base;
}
@@ -15,6 +15,21 @@ public class HudListOBJ {
All = "所有位置";
}
public boolean check(){
if(List == null)
return true;
if(Lyric == null)
return true;
if(Info == null)
return true;
if(All == null)
return true;
if(Pic == null)
return true;
return false;
}
public String getAll() {
return All;
}
@@ -17,6 +17,23 @@ public class HudOBJ {
NoLyric = "无歌词";
}
public boolean check(){
if(State == null)
return true;
if(Set == null)
return true;
if(Reset == null)
return true;
if(NoMusic == null)
return true;
if(NoList == null)
return true;
if(NoLyric == null)
return true;
return false;
}
public String getReset() {
return Reset;
}
@@ -11,6 +11,18 @@ public class ListMusicOBJ {
Get = "§d[AllMusic]§2歌曲列表%ListName%获取成功";
}
public boolean check() {
boolean res = false;
if (Head == null)
res = true;
if (Item == null)
res = true;
if (Get == null)
res = true;
return res;
}
public String getGet() {
return Get;
}
@@ -9,6 +9,15 @@ public class LyricOBJ {
TData = "%Lyric%(%TLyric%)";
}
public boolean check(){
if(Data == null)
return true;
if(TData == null)
return true;
return false;
}
public String getData() {
return Data;
}
@@ -91,65 +91,62 @@ public class MessageOBJ {
public boolean check() {
boolean saveConfig = false;
if (MusicPlay == null) {
if (MusicPlay == null || MusicPlay.check()) {
saveConfig = true;
MusicPlay = new MusicPlayOBJ();
}
if (AddMusic == null) {
if (AddMusic == null || AddMusic.check()) {
saveConfig = true;
AddMusic = new AddMusicOBJ();
}
if (Page == null) {
if (Page == null || Page.check()) {
saveConfig = true;
Page = new PageOBJ();
}
if (Lyric == null) {
if (Lyric == null || Lyric.check()) {
saveConfig = true;
Lyric = new LyricOBJ();
}
if (Vote == null) {
if (Vote == null || Vote.check()) {
saveConfig = true;
Vote = new VoteOBJ();
}
if (Search == null) {
if (Search == null || Search.check()) {
saveConfig = true;
Search = new SearchOBJ();
}
if (Hud == null) {
if (Hud == null || Hud.check()) {
saveConfig = true;
Hud = new HudOBJ();
}
if (HudList == null) {
if (HudList == null || HudList.check()) {
saveConfig = true;
HudList = new HudListOBJ();
}
if (Command == null) {
if (Command == null || Command.check()) {
saveConfig = true;
Command = new CommandOBJ();
}
if (Custom == null) {
if (Custom == null || Custom.check()) {
saveConfig = true;
Custom = new CustomOBJ();
}
if (PAPI == null) {
if (PAPI == null || PAPI.check()) {
saveConfig = true;
PAPI = new PAPIOBJ();
}
if (Cost == null) {
if (Cost == null || Cost.check()) {
saveConfig = true;
Cost = new CostObj();
}
if (Click == null) {
if (Click == null || Click.check()) {
saveConfig = true;
Click = new ClickObj();
}
if (Help == null) {
if (Help == null || Help.check()) {
saveConfig = true;
Help = new HelpObj();
}
if (Help.check()) {
saveConfig = true;
}
return saveConfig;
}
}
@@ -29,6 +29,36 @@ public class MusicPlayOBJ {
Trail = "§d[AllMusic]§2该音乐为试听音乐";
}
public boolean check() {
boolean res = false;
if (StopPlay == null)
res = true;
if (NoMusic == null)
res = true;
if (Play == null)
res = true;
if (NoPlay == null)
res = true;
if (ListMusic == null || ListMusic.check())
res = true;
if (NoCanPlay == null)
res = true;
if (NoPlayMusic == null)
res = true;
if (Switch == null)
res = true;
if (AddMusic == null)
res = true;
if (PlayerAdd == null)
res = true;
if (MusicInfo == null)
res = true;
if (Trail == null)
res = true;
return res;
}
public String getTrail() {
return Trail;
}
@@ -7,6 +7,13 @@ public class PAPIOBJ {
NoMusic = "没有播放的音乐";
}
public boolean check(){
if(NoMusic == null)
return true;
return false;
}
public String getNoMusic() {
return NoMusic;
}
@@ -11,6 +11,18 @@ public class PageOBJ {
Last = "§d[AllMusic]§e[§n点我上一页§r§e]";
}
public boolean check() {
boolean res = false;
if (Choice == null)
res = true;
if (Next == null)
res = true;
if (Last == null)
res = true;
return res;
}
public String getLast() {
return Last;
}
@@ -23,6 +23,29 @@ public class SearchOBJ {
CantLast = "§d[AllMusic]§c无法上一页";
}
public boolean check(){
if(NoPer == null)
return true;
if(CantSearch == null)
return true;
if(Res == null)
return true;
if(NoSearch == null)
return true;
if(ErrorNum == null)
return true;
if(Chose == null)
return true;
if(CantNext == null)
return true;
if(CantLast == null)
return true;
if(StartSearch == null)
return true;
return false;
}
public String getStartSearch() {
return StartSearch;
}
@@ -21,6 +21,27 @@ public class VoteOBJ {
Do = "§d[AllMusic]§2已切歌";
}
public boolean check(){
if(NoPermission == null)
return true;
if(DoVote == null)
return true;
if(BQ == null)
return true;
if(Agree == null)
return true;
if(BQAgree == null)
return true;
if(ARAgree == null)
return true;
if(TimeOut == null)
return true;
if(Do == null)
return true;
return false;
}
public String getDo() {
return Do;
}
+1 -1
View File
@@ -39,5 +39,5 @@
"SearchCost": 20,
"AddMusicCost": 10,
"MusicBR": "320000",
"Version": "2.14.5"
"Version": "2.14.7"
}