Fixed some ClassDefNotFoundExceptions (JavaPlugin, Bungee)

This commit is contained in:
Rsl1122 2017-09-19 17:42:01 +03:00
parent 4f3eea967a
commit 79b4793313
6 changed files with 10 additions and 11 deletions

View File

@ -45,6 +45,7 @@ public class PlanBungee extends BungeePlugin<PlanBungee> 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<PlanBungee> 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<PlanBungee> implements IPlan {
return;
}
processingQueue = new ProcessingQueue();
registerListener(new BungeePlayerListener(this));
Benchmark.stop("Enable", "WebServer Initialization");

View File

@ -164,7 +164,7 @@ public class TPSTable extends Table {
}
public Optional<TPS> getPeakPlayerCount(long afterDate) throws SQLException {
return getPeakPlayerCount(Plan.getServerUUID(), afterDate);
return getPeakPlayerCount(MiscUtils.getIPlan().getServerUuid(), afterDate);
}
public Optional<TPS> getPeakPlayerCount(UUID serverUUID, long afterDate) throws SQLException {

View File

@ -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());

View File

@ -90,7 +90,7 @@ public class MiscUtils {
* @return Alphabetically sorted list of matching player names.
*/
public static List<String> getMatchingPlayerNames(String search) {
Database db = Plan.getInstance().getDB();
Database db = getIPlan().getDB();
List<String> matches;
try {
matches = db.getUsersTable().getMatchingNames(search);

View File

@ -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;
}

View File

@ -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;
}