mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-08 18:54:44 +00:00
配置文件自纠正
This commit is contained in:
1 parent
e9c0efa6f2
commit
453ce50c84
8 files changed
+56
-37
No files matched your search
@@ -21,8 +21,29 @@ public class BanObj {
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
return banPlayers == null || banServer == null || banMusics == null || mutePlayers == null
|
||||
|| muteListPlayers == null;
|
||||
boolean saveConfig = false;
|
||||
if (banPlayers == null) {
|
||||
banPlayers = new HashSet<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
if (banServer == null) {
|
||||
banServer = new HashSet<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
if (mutePlayers == null) {
|
||||
mutePlayers = new HashSet<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
if (muteListPlayers == null) {
|
||||
muteListPlayers = new HashSet<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
if (banMusics == null) {
|
||||
banMusics = new HashMap<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
|
||||
return saveConfig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ConfigObj {
|
||||
saveConfig = true;
|
||||
adminList = new HashSet<>();
|
||||
}
|
||||
if (economy == null || economy.check()) {
|
||||
if (economy == null) {
|
||||
saveConfig = true;
|
||||
economy = EconomyObj.make();
|
||||
}
|
||||
|
||||
@@ -6,18 +6,8 @@ public class EconomyObj {
|
||||
|
||||
public static EconomyObj make() {
|
||||
EconomyObj obj = new EconomyObj();
|
||||
obj.init();
|
||||
|
||||
obj.backend = "server1";
|
||||
obj.vault = true;
|
||||
return obj;
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
backend = "Server1";
|
||||
vault = true;
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,9 @@ public class FunConfigObj {
|
||||
|
||||
public static FunConfigObj make() {
|
||||
FunConfigObj obj = new FunConfigObj();
|
||||
obj.init();
|
||||
obj.rain = true;
|
||||
obj.rainRate = 10;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
rain = true;
|
||||
rainRate = 10;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.coloryr.allmusic.server.core.objs.config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class MusicListObj {
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
return musics == null;
|
||||
boolean saveConfig = false;
|
||||
if (musics == null) {
|
||||
musics = new HashMap<>();
|
||||
saveConfig = true;
|
||||
}
|
||||
return saveConfig;
|
||||
}
|
||||
}
|
||||
@@ -32,10 +32,13 @@ public class BanSave {
|
||||
}
|
||||
|
||||
private static void banCheck() {
|
||||
if (ban == null || ban.check()) {
|
||||
if (ban == null) {
|
||||
ban = BanObj.make();
|
||||
AllMusic.log.data("<light_purple>[AllMusic]<red>配置文件ban.json错误,已覆盖");
|
||||
saveBan();
|
||||
} else if (ban.check()) {
|
||||
AllMusic.log.data("<light_purple>[AllMusic]<red>配置文件ban.json错误,已覆盖");
|
||||
saveBan();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,13 @@ public class MusicListSave {
|
||||
}
|
||||
|
||||
public static void musicListCheck() {
|
||||
if (musicObj == null || musicObj.check()) {
|
||||
if (musicObj == null) {
|
||||
musicObj = MusicListObj.make();
|
||||
AllMusic.log.data("<light_purple>[AllMusic]<red>配置文件music.json错误,已覆盖");
|
||||
saveMusicList();
|
||||
} else if (musicObj.check()) {
|
||||
AllMusic.log.data("<light_purple>[AllMusic]<red>配置文件music.json错误,已覆盖");
|
||||
saveMusicList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -60,19 +60,19 @@ include(":server:velocity")
|
||||
|
||||
include(":onejar")
|
||||
|
||||
include(":onejar:fabric_1_16_5")
|
||||
include(":onejar:fabric_1_20_1")
|
||||
include(":onejar:fabric_1_21")
|
||||
include(":onejar:fabric_1_21_4")
|
||||
include(":onejar:fabric_1_21_6")
|
||||
include(":onejar:fabric_1_21_11")
|
||||
include(":onejar:fabric_26_1")
|
||||
include(":onejar:fabric_26_2")
|
||||
include(":onejar:neoforge_1_21")
|
||||
include(":onejar:neoforge_1_21_4")
|
||||
include(":onejar:neoforge_1_21_6")
|
||||
include(":onejar:neoforge_1_21_11")
|
||||
include(":onejar:neoforge_26_1")
|
||||
//include(":onejar:fabric_1_16_5")
|
||||
//include(":onejar:fabric_1_20_1")
|
||||
//include(":onejar:fabric_1_21")
|
||||
//include(":onejar:fabric_1_21_4")
|
||||
//include(":onejar:fabric_1_21_6")
|
||||
//include(":onejar:fabric_1_21_11")
|
||||
//include(":onejar:fabric_26_1")
|
||||
//include(":onejar:fabric_26_2")
|
||||
//include(":onejar:neoforge_1_21")
|
||||
//include(":onejar:neoforge_1_21_4")
|
||||
//include(":onejar:neoforge_1_21_6")
|
||||
//include(":onejar:neoforge_1_21_11")
|
||||
//include(":onejar:neoforge_26_1")
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
|
||||
Reference in new issue
Block a user