From 79b4793313158f7fff2282d28717d115be9ed8b4 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 19 Sep 2017 17:42:01 +0300 Subject: [PATCH] Fixed some ClassDefNotFoundExceptions (JavaPlugin, Bungee) --- Plan/src/main/java/com/djrapitops/plan/PlanBungee.java | 7 +++---- .../java/com/djrapitops/plan/database/tables/TPSTable.java | 2 +- .../plan/systems/webserver/APIResponseHandler.java | 3 +-- .../main/java/com/djrapitops/plan/utilities/MiscUtils.java | 2 +- .../java/com/djrapitops/plan/utilities/html/HtmlUtils.java | 3 ++- .../com/djrapitops/plan/utilities/uuid/UUIDUtility.java | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java index 077c62cdc..c6ddd558b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java @@ -45,6 +45,7 @@ public class PlanBungee extends BungeePlugin implements IPlan { public void onEnable() { try { super.setInstance(this); + super.copyDefaultConfig("Plan Config | More info at https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/documentation/Configuration.md"); super.setDebugMode(Settings.DEBUG.toString()); super.getPluginLogger().setFolder(getDataFolder()); super.setColorScheme(new ColorScheme(ChatColor.GREEN, ChatColor.GRAY, ChatColor.WHITE)); @@ -52,16 +53,12 @@ public class PlanBungee extends BungeePlugin implements IPlan { super.setUpdateCheckUrl("https://raw.githubusercontent.com/Rsl1122/Plan-PlayerAnalytics/master/Plan/src/main/resources/plugin.yml"); super.setUpdateUrl("https://www.spigotmc.org/resources/plan-player-analytics.32536/"); - super.copyDefaultConfig("Plan Config | More info at https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/documentation/Configuration.md"); - super.onEnableDefaultTasks(); variableHolder = new ServerVariableHolder(getProxy()); new Locale(this).loadLocale(); - processingQueue = new ProcessingQueue(); - Log.info(Locale.get(Msg.ENABLE_DB_INIT).toString()); initDatabase(); @@ -86,6 +83,8 @@ public class PlanBungee extends BungeePlugin implements IPlan { return; } + processingQueue = new ProcessingQueue(); + registerListener(new BungeePlayerListener(this)); Benchmark.stop("Enable", "WebServer Initialization"); diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java index dafaed9c6..267105928 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java @@ -164,7 +164,7 @@ public class TPSTable extends Table { } public Optional getPeakPlayerCount(long afterDate) throws SQLException { - return getPeakPlayerCount(Plan.getServerUUID(), afterDate); + return getPeakPlayerCount(MiscUtils.getIPlan().getServerUuid(), afterDate); } public Optional getPeakPlayerCount(UUID serverUUID, long afterDate) throws SQLException { diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIResponseHandler.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIResponseHandler.java index fc81f0be8..41335f6d9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIResponseHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIResponseHandler.java @@ -5,7 +5,6 @@ package main.java.com.djrapitops.plan.systems.webserver; import main.java.com.djrapitops.plan.Log; -import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.systems.webserver.response.ForbiddenResponse; import main.java.com.djrapitops.plan.systems.webserver.response.NotFoundResponse; import main.java.com.djrapitops.plan.systems.webserver.response.Response; @@ -89,7 +88,7 @@ public class APIResponseHandler { Log.debug(request.toString()); Log.debug(requestBody); - Response response = api.processRequest(Plan.getInstance(), variables); + Response response = api.processRequest(MiscUtils.getIPlan(), variables); Log.debug(response.toString()); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java index cd2dd33ed..5cdeb9764 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java @@ -90,7 +90,7 @@ public class MiscUtils { * @return Alphabetically sorted list of matching player names. */ public static List getMatchingPlayerNames(String search) { - Database db = Plan.getInstance().getDB(); + Database db = getIPlan().getDB(); List matches; try { matches = db.getUsersTable().getMatchingNames(search); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java index cd82bff1b..79df118dc 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java @@ -3,6 +3,7 @@ package main.java.com.djrapitops.plan.utilities.html; import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Settings; import main.java.com.djrapitops.plan.systems.webserver.WebServer; +import main.java.com.djrapitops.plan.utilities.MiscUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.StrSubstitutor; @@ -59,7 +60,7 @@ public class HtmlUtils { if (Settings.SHOW_ALTERNATIVE_IP.isTrue()) { ip = Settings.ALTERNATIVE_IP.toString().replace("%port%", String.valueOf(port)); } else { - ip = Plan.getInstance().getVariable().getIp() + ":" + port; + ip = MiscUtils.getIPlan().getVariable().getIp() + ":" + port; } return ip; } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/uuid/UUIDUtility.java b/Plan/src/main/java/com/djrapitops/plan/utilities/uuid/UUIDUtility.java index 6317c3b83..d3ccb4e11 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/uuid/UUIDUtility.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/uuid/UUIDUtility.java @@ -7,8 +7,8 @@ package main.java.com.djrapitops.plan.utilities.uuid; import com.djrapitops.plugin.utilities.player.UUIDFetcher; import main.java.com.djrapitops.plan.Log; -import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.database.Database; +import main.java.com.djrapitops.plan.utilities.MiscUtils; import java.sql.SQLException; import java.util.UUID; @@ -31,7 +31,7 @@ public class UUIDUtility { */ public static UUID getUUIDOf(String playername) { try { - return getUUIDOf(playername, Plan.getInstance().getDB()); + return getUUIDOf(playername, MiscUtils.getIPlan().getDB()); } catch (Exception e) { return null; }