diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index dc5573105..85467cefa 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1252,15 +1252,15 @@ public class PlotMain extends JavaPlugin { return plots; } - public static void setAllPlotsRaw(final LinkedHashMap> plots) { - PlotMain.plots = plots; - } - public static void setAllPlotsRaw(final HashMap> plots) { PlotMain.plots = new LinkedHashMap<>(plots); // PlotMain.plots.putAll(plots); } + public static void setAllPlotsRaw(final LinkedHashMap> plots) { + PlotMain.plots = plots; + } + /** * !!WorldGeneration!! */ @@ -1343,10 +1343,6 @@ public class PlotMain extends JavaPlugin { // Use mysql? if (Settings.DB.USE_MYSQL) { - // TODO: Remake SQLManager - if (DBFunc.dbManager == null) { - DBFunc.dbManager = new SQLManager(connection, Settings.DB.PREFIX); - } try { mySQL = new MySQL(this, Settings.DB.HOST_NAME, Settings.DB.PORT, Settings.DB.DATABASE, Settings.DB.USER, Settings.DB.PASSWORD); connection = mySQL.openConnection(); @@ -1377,15 +1373,16 @@ public class PlotMain extends JavaPlugin { Bukkit.getPluginManager().disablePlugin(this); return; } + if (DBFunc.dbManager == null) { + DBFunc.dbManager = new SQLManager(connection, Settings.DB.PREFIX); + } plots = DBFunc.getPlots(); - } // TODO: Implement mongo else if (Settings.DB.USE_MONGO) { // DBFunc.dbManager = new MongoManager(); sendConsoleSenderMessage(C.PREFIX.s() + "MongoDB is not yet implemented"); } else if (Settings.DB.USE_SQLITE) { - DBFunc.dbManager = new SQLManager(connection, Settings.DB.PREFIX); try { connection = new SQLite(this, Settings.DB.SQLITE_DB + ".db").openConnection(); { @@ -1410,6 +1407,7 @@ public class PlotMain extends JavaPlugin { Bukkit.getPluginManager().disablePlugin(this); return; } + DBFunc.dbManager = new SQLManager(connection, Settings.DB.PREFIX); plots = DBFunc.getPlots(); } else { Logger.add(LogLevel.DANGER, "No storage type is set."); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java index 42ab0ddd0..214d721b6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java @@ -95,7 +95,7 @@ public enum Command { /** * */ - DEBUG("debug", "database", new CommandPermission("plots.admin")), + DEBUG("debug", "debug", new CommandPermission("plots.admin")), /** * */