From 0914b7bec93fcd6ba15432dfd5c33ac43a8dd42a Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sat, 15 Nov 2014 12:29:30 +0100 Subject: [PATCH] Minor remake xD --- .../intellectualcrafters/plot/PlotMain.java | 18 ++++++++---------- .../plot/commands/Command.java | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) 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")), /** * */