Rewiring SQL to the new config pt 2

This commit is contained in:
nossr50 2019-03-12 00:27:47 -07:00
parent 707e6d0342
commit 45e785bd1f
5 changed files with 5 additions and 9 deletions

View File

@ -1,8 +1,8 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -22,7 +22,7 @@ public class MmoshowdbCommand implements TabExecutor {
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (MainConfig.getInstance().getUseMySQL() ? "sql" : "flatfile")));
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (mcMMO.getMySQLConfigSettings().isMySQLEnabled() ? "sql" : "flatfile")));
return true;
default:

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.config;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.config.hocon.database;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.mcMMO;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.database;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.mcMMO;
@ -20,10 +19,10 @@ public class DatabaseManagerFactory {
mcMMO.p.debug("Failed to create custom database manager");
e.printStackTrace();
}
mcMMO.p.debug("Falling back on " + (MainConfig.getInstance().getUseMySQL() ? "SQL" : "Flatfile") + " database");
mcMMO.p.debug("Falling back on " + (mcMMO.getMySQLConfigSettings().isMySQLEnabled() ? "SQL" : "Flatfile") + " database");
}
return MainConfig.getInstance().getUseMySQL() ? new SQLDatabaseManager() : new FlatfileDatabaseManager();
return mcMMO.getMySQLConfigSettings().isMySQLEnabled() ? new SQLDatabaseManager() : new FlatfileDatabaseManager();
}
/**

View File

@ -1,6 +1,5 @@
package net.shatteredlands.shatt.backup;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.mcMMO;
import java.io.File;
@ -27,7 +26,7 @@ public class ZipLibrary {
private static File REPAIR_FILE = new File(mcMMO.getMainDirectory() + "repair.vanilla.yml");*/
public static void mcMMOBackup() throws IOException {
if (MainConfig.getInstance().getUseMySQL()) {
if (mcMMO.getMySQLConfigSettings().isMySQLEnabled()) {
mcMMO.p.debug("This server is running in SQL Mode.");
mcMMO.p.debug("Only config files will be backed up.");
}