mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-06 11:06:58 +00:00
调整配置文件功能
This commit is contained in:
@ -10,35 +10,52 @@ import gg.frog.mc.permissionstime.utils.config.PluginConfig;
|
||||
*
|
||||
*/
|
||||
public class PluginCfg extends PluginConfig {
|
||||
|
||||
public static String PLUGIN_PREFIX = null;
|
||||
public static Boolean IS_METRICS = null;
|
||||
public static Boolean IS_DEBUG = null;
|
||||
public static String LANG = null;
|
||||
|
||||
public static String PLUGIN_PREFIX ;
|
||||
public static boolean IS_METRICS = true;
|
||||
public static boolean IS_DEBUG = false;
|
||||
public static String LANG;
|
||||
public static boolean USE_MYSQL = false;
|
||||
public static String SQL_HOSTNAME;
|
||||
public static int SQL_PORT;
|
||||
public static String SQL_DATABASE;
|
||||
public static String SQL_USERNAME;
|
||||
public static String SQL_PASSWORD;
|
||||
|
||||
public static String SQL_TABLE_PREFIX;
|
||||
|
||||
public PluginCfg() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
getConfig().set("lang","zh-cn");
|
||||
getConfig().set("lang", "zh-cn");
|
||||
getConfig().set("metrics", true);
|
||||
getConfig().set("debug", false);
|
||||
saveConfig();
|
||||
getConfig().set("mysql.enable", false);
|
||||
getConfig().set("mysql.hostname", "localhost");
|
||||
getConfig().set("mysql.port", 3306);
|
||||
getConfig().set("mysql.database", "minecraft");
|
||||
getConfig().set("mysql.username", "user");
|
||||
getConfig().set("mysql.password", "123456");
|
||||
getConfig().set("mysql.tablePrefix", "pt_");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadToDo() {
|
||||
PLUGIN_PREFIX = getConfig().getString("pluginPrefix","&b["+PluginMain.PLUGIN_NAME+"]&r");
|
||||
IS_DEBUG = getConfig().getBoolean("debug", false);
|
||||
IS_METRICS = getConfig().getBoolean("metrics", true);
|
||||
LANG = getConfig().getString("lang","zh-cn");
|
||||
PLUGIN_PREFIX = setGetDefault("pluginPrefix", "&b[" + PluginMain.PLUGIN_NAME + "]&r");
|
||||
IS_DEBUG = setGetDefault("debug", false);
|
||||
IS_METRICS = setGetDefault("metrics", true);
|
||||
LANG = setGetDefault("lang", "zh-cn");
|
||||
USE_MYSQL = setGetDefault("mysql.enable", false);
|
||||
if (!USE_MYSQL) {
|
||||
SQL_HOSTNAME = setGetDefault("mysql.hostname", "localhost");
|
||||
SQL_PORT = setGetDefault("mysql.port", 3306);
|
||||
SQL_DATABASE = setGetDefault("mysql.database", "minecraft");
|
||||
SQL_USERNAME = setGetDefault("mysql.username", "user");
|
||||
SQL_PASSWORD = setGetDefault("mysql.password", "123456");
|
||||
SQL_TABLE_PREFIX = setGetDefault("mysql.tablePrefix", "pt_");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user