mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
This can never be null, and there's no reason to pass that as a variable.
This commit is contained in:
parent
9c6d1ce020
commit
57541ec233
@ -236,24 +236,17 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
/* mySQL */
|
||||
public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); }
|
||||
public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); }
|
||||
public String getMySQLDatabaseName() { return getStringIncludingInts(config, "MySQL.Database.Name"); }
|
||||
public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); }
|
||||
public String getMySQLDatabaseName() { return getStringIncludingInts("MySQL.Database.Name"); }
|
||||
public String getMySQLUserName() { return getStringIncludingInts("MySQL.Database.User_Name"); }
|
||||
public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
|
||||
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
|
||||
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
|
||||
|
||||
public String getMySQLUserPassword() {
|
||||
if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) {
|
||||
return getStringIncludingInts(config, "MySQL.Database.User_Password");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private static String getStringIncludingInts(ConfigurationSection cfg, String key) {
|
||||
String str = cfg.getString(key);
|
||||
private String getStringIncludingInts(String key) {
|
||||
String str = config.getString(key);
|
||||
|
||||
if (str == null) {
|
||||
str = String.valueOf(cfg.getInt(key));
|
||||
str = String.valueOf(config.getInt(key));
|
||||
}
|
||||
|
||||
if (str.equals("0")) {
|
||||
|
Loading…
Reference in New Issue
Block a user