diff --git a/Plan/src/main/java/com/djrapitops/plan/Plan.java b/Plan/src/main/java/com/djrapitops/plan/Plan.java index a6f1e9017..a45871d16 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Plan.java +++ b/Plan/src/main/java/com/djrapitops/plan/Plan.java @@ -19,30 +19,19 @@ */ package com.djrapitops.plan; -import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.command.PlanCommand; import com.djrapitops.plan.data.plugin.HookHandler; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; -import com.djrapitops.plan.settings.theme.PlanColorScheme; -import com.djrapitops.plan.settings.theme.Theme; import com.djrapitops.plan.system.BukkitSystem; -import com.djrapitops.plan.system.cache.GeolocationCache; import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.databases.Database; -import com.djrapitops.plan.system.file.FileSystem; -import com.djrapitops.plan.system.info.server.BukkitServerInfo; import com.djrapitops.plan.system.info.server.ServerInfo; -import com.djrapitops.plan.system.info.server.ServerProperties; import com.djrapitops.plan.system.processing.importing.ImporterManager; import com.djrapitops.plan.system.processing.importing.importers.OfflinePlayerImporter; -import com.djrapitops.plan.system.settings.Settings; -import com.djrapitops.plan.system.settings.config.ConfigSystem; -import com.djrapitops.plan.system.tasks.TaskSystem; -import com.djrapitops.plan.system.update.VersionCheckSystem; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; +import com.djrapitops.plan.system.settings.theme.PlanColorScheme; import com.djrapitops.plan.system.webserver.WebServer; import com.djrapitops.plan.system.webserver.WebServerSystem; -import com.djrapitops.plan.utilities.file.export.HtmlExport; import com.djrapitops.plan.utilities.metrics.BStats; import com.djrapitops.plugin.BukkitPlugin; import com.djrapitops.plugin.StaticHolder; @@ -51,11 +40,8 @@ import com.djrapitops.plugin.api.systems.TaskCenter; import com.djrapitops.plugin.api.utility.log.DebugLog; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.settings.ColorScheme; -import com.djrapitops.plugin.task.RunnableFactory; import org.bukkit.configuration.file.FileConfiguration; -import java.io.IOException; -import java.net.UnknownHostException; import java.util.UUID; /** @@ -73,10 +59,6 @@ public class Plan extends BukkitPlugin implements PlanPlugin { private HookHandler hookHandler; // Manages 3rd party data sources - private BukkitServerInfo serverInfoManager; - - private ServerProperties serverProperties; - /** * Used to get the plugin-instance singleton. * @@ -104,60 +86,9 @@ public class Plan extends BukkitPlugin implements PlanPlugin { public void onEnable() { super.onEnable(); try { - FileSystem.getInstance().enable(); - ConfigSystem.getInstance().enable(); - - Log.setDebugMode(Settings.DEBUG.toString()); - - VersionCheckSystem.getInstance().enable(); - Benchmark.start("Enable"); - - try { - GeolocationCache.checkDB(); - } catch (UnknownHostException e) { - Log.error("Plan Requires internet access on first run to download GeoLite2 Geolocation database."); - } catch (IOException e) { - throw new EnableException("Something went wrong saving the downloaded GeoLite2 Geolocation database", e); - } - - new Locale().loadLocale(); - - Theme.getInstance().enable(); - - Benchmark.start("Reading server variables"); - serverProperties = new ServerProperties(getServer()); - Benchmark.stop("Enable", "Reading server variables"); - - DBSystem.getInstance().enable(); - - Benchmark.start("WebServer Initialization"); - - serverInfoManager = new BukkitServerInfo(this); - WebServerSystem.getInstance().enable(); - if (!WebServerSystem.isWebServerEnabled()) { - if (Settings.WEBSERVER_DISABLED.isTrue()) { - Log.warn("WebServer was not initialized. (WebServer.DisableWebServer: true)"); - } else { - Log.error("WebServer was not initialized successfully. Is the port (" + Settings.WEBSERVER_PORT.getNumber() + ") in use?"); - - } - } - serverInfoManager.updateServerInfo(); - - Benchmark.stop("Enable", "WebServer Initialization"); - - TaskSystem.getInstance().enable(); - - boolean usingBungeeWebServer = infoManager.isUsingAnotherWebServer(); - boolean usingAlternativeIP = Settings.SHOW_ALTERNATIVE_IP.isTrue(); - - if (!usingAlternativeIP && serverProperties.getIp().isEmpty()) { - Log.infoColor(Locale.get(Msg.ENABLE_NOTIFY_EMPTY_IP).toString()); - } - if (usingBungeeWebServer && usingAlternativeIP) { - Log.info("Make sure that the alternative IP points to the Bukkit Server: " + Settings.ALTERNATIVE_IP.toString()); - } + system = new BukkitSystem(this); + system.enable(); registerCommand("plan", new PlanCommand(this)); @@ -174,11 +105,6 @@ public class Plan extends BukkitPlugin implements PlanPlugin { Benchmark.stop("Enable", "Enable"); Log.logDebug("Enable"); Log.info(Locale.get(Msg.ENABLED).toString()); - StaticHolder.saveInstance(ShutdownHook.class, this.getClass()); - new ShutdownHook(this); - if (Settings.ANALYSIS_EXPORT.isTrue()) { - RunnableFactory.createNew(new HtmlExport(this)).runTaskAsynchronously(); - } } catch (Exception e) { Log.error("Plugin Failed to Initialize Correctly."); Log.toLog(this.getClass().getName(), e); @@ -242,29 +168,6 @@ public class Plan extends BukkitPlugin implements PlanPlugin { return hookHandler; } - /** - * Used to get the object storing server variables that are constant after - * boot. - * - * @return ServerProperties - * @see ServerProperties - */ - @Deprecated - public ServerProperties getVariable() { - return serverProperties; - } - - /** - * Used to get the object storing server info - * - * @return BukkitServerInfo - * @see BukkitServerInfo - */ - @Deprecated - public BukkitServerInfo getServerInfoManager() { - return serverInfoManager; - } - public boolean isReloading() { return reloading; } diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java index 0b1cc6893..bd8cbee79 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java @@ -5,10 +5,6 @@ package com.djrapitops.plan; import com.djrapitops.plan.command.PlanBungeeCommand; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; -import com.djrapitops.plan.settings.theme.PlanColorScheme; -import com.djrapitops.plan.settings.theme.Theme; import com.djrapitops.plan.system.BungeeSystem; import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.databases.Database; @@ -17,6 +13,10 @@ import com.djrapitops.plan.system.info.server.BungeeServerInfo; import com.djrapitops.plan.system.info.server.ServerProperties; import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.settings.config.ConfigSystem; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; +import com.djrapitops.plan.system.settings.theme.PlanColorScheme; +import com.djrapitops.plan.system.settings.theme.Theme; import com.djrapitops.plan.system.tasks.TaskSystem; import com.djrapitops.plan.system.update.VersionCheckSystem; import com.djrapitops.plan.system.webserver.WebServer; @@ -147,7 +147,6 @@ public class PlanBungee extends BungeePlugin implements PlanPlugin { return PlanColorScheme.create(); } - @Override public ServerProperties getVariable() { return variableHolder; } diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanPlugin.java b/Plan/src/main/java/com/djrapitops/plan/PlanPlugin.java index d5a2204e5..f1bafd915 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanPlugin.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanPlugin.java @@ -5,7 +5,6 @@ package com.djrapitops.plan; import com.djrapitops.plan.system.database.databases.Database; -import com.djrapitops.plan.system.info.server.ServerProperties; import com.djrapitops.plan.system.webserver.WebServer; import com.djrapitops.plugin.IPlugin; import com.djrapitops.plugin.api.Check; @@ -37,9 +36,6 @@ public interface PlanPlugin extends IPlugin { @Deprecated Database getDB(); - @Deprecated - ServerProperties getVariable(); - @Deprecated UUID getServerUuid(); diff --git a/Plan/src/main/java/com/djrapitops/plan/command/PlanBungeeCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/PlanBungeeCommand.java index a89a4aa3e..1ee152878 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/PlanBungeeCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/PlanBungeeCommand.java @@ -2,9 +2,9 @@ package com.djrapitops.plan.command; import com.djrapitops.plan.PlanBungee; import com.djrapitops.plan.command.commands.*; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.TreeCommand; import com.djrapitops.plugin.command.defaultcmds.StatusCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/PlanCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/PlanCommand.java index a68bfb5db..8e7ba2efe 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/PlanCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/PlanCommand.java @@ -2,10 +2,10 @@ package com.djrapitops.plan.command; import com.djrapitops.plan.Plan; import com.djrapitops.plan.command.commands.*; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.TreeCommand; import com.djrapitops.plugin.command.defaultcmds.StatusCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java index db70f2330..dc3aeb428 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java @@ -3,8 +3,6 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; import com.djrapitops.plan.api.exceptions.connection.WebException; import com.djrapitops.plan.api.exceptions.database.DBException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.connection.ConnectionSystem; @@ -13,6 +11,8 @@ import com.djrapitops.plan.system.info.server.Server; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.processing.processors.Processor; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.system.webserver.WebServerSystem; import com.djrapitops.plan.utilities.analysis.Analysis; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/DevCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/DevCommand.java index 2b4da7b95..5aa5af2c0 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/DevCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/DevCommand.java @@ -5,20 +5,14 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.api.exceptions.connection.WebException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.info.connection.ConnectionSystem; -import com.djrapitops.plan.system.webserver.webapi.WebAPI; -import com.djrapitops.plan.system.webserver.webapi.bukkit.InspectWebAPI; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; import com.djrapitops.plugin.command.SubCommand; -import java.util.Optional; -import java.util.UUID; - /** * Command used for testing functions that are too difficult to unit test. * @@ -44,9 +38,7 @@ public class DevCommand extends SubCommand { if (!Condition.isTrue(args.length >= 2, Locale.get(Msg.CMD_FAIL_REQ_ONE_ARG).toString(), sender)) { break; } - if (!webapi(args[1] + "connection", args.length >= 3)) { - sender.sendMessage("[Plan] No such API / Exception occurred."); - } + sender.sendMessage("[Plan] No implementation."); break; case "web": ConnectionSystem connectionSystem = ConnectionSystem.getInstance(); @@ -59,29 +51,4 @@ public class DevCommand extends SubCommand { } return true; } - - private boolean webapi(String method, boolean connectToBungee) { - WebAPI api = plugin.getWebServer().getWebAPI().getAPI(method); - if (api == null) { - return false; - } - try { - String address = plugin.getWebServer().getAccessAddress(); - if (connectToBungee) { - Optional bungeeConnectionAddress = plugin.getServerInfoManager().getBungeeConnectionAddress(); - if (bungeeConnectionAddress.isPresent()) { - address = bungeeConnectionAddress.get(); - } - } - if (api instanceof InspectWebAPI) { - ((InspectWebAPI) api).sendRequest(address, UUID.randomUUID()); - } else { - api.sendRequest(address); - } - return true; - } catch (WebException e) { - e.printStackTrace(); - } - return false; - } } \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/InfoCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/InfoCommand.java index 8546feeb0..e1c5f4bf6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/InfoCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/InfoCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; import com.djrapitops.plugin.command.SubCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java index 449122e01..a0556bb31 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java @@ -3,11 +3,11 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.api.exceptions.database.FatalDBException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.processing.processors.info.InspectCacheRequestProcessor; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plan.utilities.uuid.UUIDUtility; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/ListCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/ListCommand.java index b629010d2..4b345e5d3 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/ListCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/ListCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.info.connection.ConnectionSystem; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.CommandUtils; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/ListServersCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/ListServersCommand.java index dfc47621c..d80c79e2a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/ListServersCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/ListServersCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/ManageCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/ManageCommand.java index 192130f07..1726cc496 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/ManageCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/ManageCommand.java @@ -2,9 +2,9 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; import com.djrapitops.plan.command.commands.manage.*; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.TreeCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/NetworkCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/NetworkCommand.java index 2d7f88e7e..fe2302622 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/NetworkCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/NetworkCommand.java @@ -1,10 +1,10 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.info.connection.ConnectionSystem; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.CommandUtils; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/QInspectCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/QInspectCommand.java index ad4a8ca52..323b6c569 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/QInspectCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/QInspectCommand.java @@ -4,10 +4,10 @@ import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.data.PlayerProfile; import com.djrapitops.plan.data.element.ActivityIndex; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.MiscUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/RegisterCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/RegisterCommand.java index d0e5ed92a..082115400 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/RegisterCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/RegisterCommand.java @@ -2,10 +2,10 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.data.WebUser; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.sql.tables.SecurityTable; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.PassEncryptUtil; import com.djrapitops.plugin.api.Check; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/ReloadCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/ReloadCommand.java index 89a99979e..1dc3a2386 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/ReloadCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/ReloadCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/SearchCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/SearchCommand.java index c48ea78e2..c0538e04b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/SearchCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/SearchCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plugin.command.CommandType; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/WebUserCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/WebUserCommand.java index 74c203b35..3c3915338 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/WebUserCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/WebUserCommand.java @@ -7,9 +7,9 @@ import com.djrapitops.plan.command.commands.webuser.WebCheckCommand; import com.djrapitops.plan.command.commands.webuser.WebDeleteCommand; import com.djrapitops.plan.command.commands.webuser.WebLevelCommand; import com.djrapitops.plan.command.commands.webuser.WebListUsersCommand; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.TreeCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageBackupCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageBackupCommand.java index 0463ca3ea..0b485b18c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageBackupCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageBackupCommand.java @@ -2,10 +2,10 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; import com.djrapitops.plan.api.exceptions.database.DBInitException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.ManageUtils; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageClearCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageClearCommand.java index b5c0d2930..b577c6945 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageClearCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageClearCommand.java @@ -5,11 +5,11 @@ import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.api.exceptions.database.DBInitException; import com.djrapitops.plan.api.exceptions.database.FatalDBException; import com.djrapitops.plan.data.container.Session; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.ManageUtils; import com.djrapitops.plan.utilities.MiscUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageDisableCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageDisableCommand.java index 3fcd989f2..cf00f566f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageDisableCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageDisableCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands.manage; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.listeners.bukkit.PlayerOnlineListener; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageHotswapCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageHotswapCommand.java index e66e160f9..ec7484d82 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageHotswapCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageHotswapCommand.java @@ -1,12 +1,12 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java index 9110ac378..28ea80b7c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java @@ -1,10 +1,10 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.processing.importing.ImporterManager; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java index f3f93c5de..4d0bc2a9e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java @@ -1,10 +1,10 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.ManageUtils; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java index 636a9e3e9..9a517a5fc 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java @@ -3,11 +3,11 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.data.container.Session; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plan.utilities.uuid.UUIDUtility; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java index 9f023a2ee..424581157 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java @@ -1,11 +1,11 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.database.databases.sql.SQLiteDB; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plan.utilities.ManageUtils; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageSetupCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageSetupCommand.java index b964eeefb..849d7e65b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageSetupCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageSetupCommand.java @@ -3,10 +3,10 @@ package com.djrapitops.plan.command.commands.manage; import com.djrapitops.plan.Plan; import com.djrapitops.plan.api.exceptions.connection.ForbiddenException; import com.djrapitops.plan.api.exceptions.connection.WebException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.system.webserver.webapi.bungee.RequestSetupWebAPI; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebCheckCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebCheckCommand.java index 387bcb7c3..b15f42188 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebCheckCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebCheckCommand.java @@ -2,10 +2,10 @@ package com.djrapitops.plan.command.commands.webuser; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.data.WebUser; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.sql.tables.SecurityTable; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebDeleteCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebDeleteCommand.java index 3029b142a..3a9d0602d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebDeleteCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebDeleteCommand.java @@ -1,10 +1,10 @@ package com.djrapitops.plan.command.commands.webuser; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.sql.tables.SecurityTable; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.Condition; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebLevelCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebLevelCommand.java index 0bf6f26e0..033f436ac 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebLevelCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebLevelCommand.java @@ -1,9 +1,9 @@ package com.djrapitops.plan.command.commands.webuser; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.command.CommandType; import com.djrapitops.plugin.command.ISender; import com.djrapitops.plugin.command.SubCommand; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java index f067343b2..f86d42e21 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java @@ -2,9 +2,9 @@ package com.djrapitops.plan.command.commands.webuser; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.data.WebUser; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Permissions; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.comparators.WebUserComparator; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandType; diff --git a/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java b/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java index d7671546e..baad80760 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java @@ -8,9 +8,9 @@ import com.djrapitops.plan.data.element.AnalysisContainer; import com.djrapitops.plan.data.element.HealthNotes; import com.djrapitops.plan.data.plugin.PluginData; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plan.utilities.analysis.AnalysisUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/BukkitSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/BukkitSystem.java index 30072f078..bdda879db 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/BukkitSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/BukkitSystem.java @@ -13,6 +13,7 @@ import com.djrapitops.plan.system.listeners.BukkitListenerSystem; import com.djrapitops.plan.system.settings.config.BukkitConfigSystem; import com.djrapitops.plan.system.tasks.BukkitTaskSystem; import com.djrapitops.plan.system.update.VersionCheckSystem; +import com.djrapitops.plugin.StaticHolder; /** * Represents PlanSystem for Plan. @@ -31,6 +32,7 @@ public class BukkitSystem extends PlanSystem { serverInfo = new BukkitServerInfo(plugin); + StaticHolder.saveInstance(ShutdownHook.class, plugin.getClass()); new ShutdownHook().register(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/DBSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/database/DBSystem.java index cc0de459f..ed4e92798 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/DBSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/DBSystem.java @@ -7,11 +7,11 @@ package com.djrapitops.plan.system.database; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.api.exceptions.database.DBInitException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.SubSystem; import com.djrapitops.plan.system.database.databases.Database; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.NullCheck; import com.djrapitops.plugin.api.Benchmark; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BukkitConnectionSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BukkitConnectionSystem.java index 3494ea383..71e675d03 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BukkitConnectionSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BukkitConnectionSystem.java @@ -10,6 +10,10 @@ import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.request.*; import com.djrapitops.plan.system.info.server.Server; import com.djrapitops.plan.system.info.server.ServerInfo; +import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; +import com.djrapitops.plan.system.webserver.WebServerSystem; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plugin.api.TimeAmount; import com.djrapitops.plugin.api.utility.log.Log; @@ -108,6 +112,17 @@ public class BukkitConnectionSystem extends ConnectionSystem { refreshServerMap(); } }).runTaskTimerAsynchronously(TimeAmount.SECOND.ticks() * 30L, TimeAmount.MINUTE.ticks() * 5L); + + boolean usingBungeeWebServer = ConnectionSystem.getInstance().isServerAvailable(); + boolean usingAlternativeIP = Settings.SHOW_ALTERNATIVE_IP.isTrue(); + + if (!usingAlternativeIP && ServerInfo.getServerProperties().getIp().isEmpty()) { + Log.infoColor(Locale.get(Msg.ENABLE_NOTIFY_EMPTY_IP).toString()); + } + if (usingBungeeWebServer && usingAlternativeIP) { + String webServerAddress = WebServerSystem.getInstance().getWebServer().getAccessAddress(); + Log.info("Make sure that this address points to the Bukkit Server: " + webServerAddress); + } } @Override diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/GamemodeChangeListener.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/GamemodeChangeListener.java index 6a94870d6..39956f151 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/GamemodeChangeListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/GamemodeChangeListener.java @@ -2,8 +2,8 @@ package com.djrapitops.plan.system.listeners.bukkit; import com.djrapitops.plan.Plan; import com.djrapitops.plan.data.container.Session; -import com.djrapitops.plan.settings.WorldAliasSettings; import com.djrapitops.plan.system.cache.SessionCache; +import com.djrapitops.plan.system.settings.WorldAliasSettings; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plugin.api.utility.log.Log; import org.bukkit.entity.Player; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/WorldChangeListener.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/WorldChangeListener.java index 0dc9de33d..18a038218 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/WorldChangeListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/WorldChangeListener.java @@ -1,8 +1,8 @@ package com.djrapitops.plan.system.listeners.bukkit; import com.djrapitops.plan.data.container.Session; -import com.djrapitops.plan.settings.WorldAliasSettings; import com.djrapitops.plan.system.cache.SessionCache; +import com.djrapitops.plan.system.settings.WorldAliasSettings; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plugin.api.utility.log.Log; import org.bukkit.entity.Player; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/info/InspectCacheRequestProcessor.java b/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/info/InspectCacheRequestProcessor.java index 17b4af5ca..ed0be671f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/info/InspectCacheRequestProcessor.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/info/InspectCacheRequestProcessor.java @@ -5,12 +5,12 @@ package com.djrapitops.plan.system.processing.processors.info; import com.djrapitops.plan.api.exceptions.connection.*; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.connection.ConnectionSystem; import com.djrapitops.plan.system.processing.processors.player.PlayerProcessor; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.command.CommandUtils; import com.djrapitops.plugin.command.ISender; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/ServerSpecificSettings.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/ServerSpecificSettings.java similarity index 98% rename from Plan/src/main/java/com/djrapitops/plan/settings/ServerSpecificSettings.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/ServerSpecificSettings.java index ce62a2f25..a46b7b074 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/ServerSpecificSettings.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/ServerSpecificSettings.java @@ -2,10 +2,9 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings; +package com.djrapitops.plan.system.settings; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.settings.config.ConfigSystem; import com.djrapitops.plugin.api.config.Config; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/settings/Settings.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/Settings.java index 6c9362d39..c69dcd7e5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/settings/Settings.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/Settings.java @@ -1,6 +1,5 @@ package com.djrapitops.plan.system.settings; -import com.djrapitops.plan.settings.ServerSpecificSettings; import com.djrapitops.plan.system.settings.config.ConfigSystem; import com.djrapitops.plugin.api.Check; import com.djrapitops.plugin.api.config.Config; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/WorldAliasSettings.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/WorldAliasSettings.java similarity index 95% rename from Plan/src/main/java/com/djrapitops/plan/settings/WorldAliasSettings.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/WorldAliasSettings.java index bb7f3e398..80703f0bf 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/WorldAliasSettings.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/WorldAliasSettings.java @@ -2,9 +2,8 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings; +package com.djrapitops.plan.system.settings; -import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.settings.config.ConfigSystem; import com.djrapitops.plugin.api.config.Config; import com.djrapitops.plugin.api.config.ConfigNode; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/settings/config/ConfigSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/config/ConfigSystem.java index 347b33441..9f02cb10f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/settings/config/ConfigSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/config/ConfigSystem.java @@ -5,11 +5,12 @@ package com.djrapitops.plan.system.settings.config; import com.djrapitops.plan.api.exceptions.EnableException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.theme.Theme; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.SubSystem; import com.djrapitops.plan.system.file.FileSystem; +import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.theme.Theme; import com.djrapitops.plan.utilities.NullCheck; import com.djrapitops.plugin.api.config.Config; import com.djrapitops.plugin.api.utility.log.Log; @@ -52,6 +53,7 @@ public abstract class ConfigSystem implements SubSystem { try { copyDefaults(); config.save(); + Log.setDebugMode(Settings.DEBUG.toString()); } catch (IOException e) { throw new EnableException("Failed to save default config.", e); } diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Locale.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Locale.java similarity index 99% rename from Plan/src/main/java/com/djrapitops/plan/settings/locale/Locale.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Locale.java index e79fd1a93..879180841 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Locale.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Locale.java @@ -1,4 +1,4 @@ -package com.djrapitops.plan.settings.locale; +package com.djrapitops.plan.system.settings.locale; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.system.file.FileSystem; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Message.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Message.java similarity index 95% rename from Plan/src/main/java/com/djrapitops/plan/settings/locale/Message.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Message.java index 4d60107f3..563ebfe6e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Message.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Message.java @@ -1,4 +1,4 @@ -package com.djrapitops.plan.settings.locale; +package com.djrapitops.plan.system.settings.locale; import com.djrapitops.plugin.utilities.Verify; import org.apache.commons.lang3.text.StrSubstitutor; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Msg.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Msg.java similarity index 99% rename from Plan/src/main/java/com/djrapitops/plan/settings/locale/Msg.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Msg.java index 41d04c437..cf6c6c19a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/locale/Msg.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/locale/Msg.java @@ -1,4 +1,4 @@ -package com.djrapitops.plan.settings.locale; +package com.djrapitops.plan.system.settings.locale; import java.util.Arrays; import java.util.Map; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/PlanColorScheme.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/PlanColorScheme.java similarity index 95% rename from Plan/src/main/java/com/djrapitops/plan/settings/theme/PlanColorScheme.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/theme/PlanColorScheme.java index b2d103b51..f28f6a8dd 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/PlanColorScheme.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/PlanColorScheme.java @@ -2,7 +2,7 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings.theme; +package com.djrapitops.plan.system.settings.theme; import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java similarity index 98% rename from Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java index 5b1cc3081..ea89ac54f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java @@ -2,7 +2,7 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings.theme; +package com.djrapitops.plan.system.settings.theme; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.system.SubSystem; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeConfig.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeConfig.java similarity index 97% rename from Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeConfig.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeConfig.java index f017478bf..67e0d8b6f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeConfig.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeConfig.java @@ -2,7 +2,7 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings.theme; +package com.djrapitops.plan.system.settings.theme; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.utilities.file.FileUtil; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeVal.java similarity index 98% rename from Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java rename to Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeVal.java index 42f475838..907e3cc8e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/ThemeVal.java @@ -2,7 +2,7 @@ * Licence is provided in the jar as license.yml also here: * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml */ -package com.djrapitops.plan.settings.theme; +package com.djrapitops.plan.system.settings.theme; /** * Enum class used for getting the Html colors that match the config settings. diff --git a/Plan/src/main/java/com/djrapitops/plan/system/tasks/BukkitTaskSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/tasks/BukkitTaskSystem.java index abc8f889c..839907a52 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/tasks/BukkitTaskSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/tasks/BukkitTaskSystem.java @@ -5,15 +5,17 @@ package com.djrapitops.plan.system.tasks; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.system.tasks.bukkit.*; +import com.djrapitops.plan.utilities.file.export.HtmlExport; import com.djrapitops.plugin.api.Benchmark; import com.djrapitops.plugin.api.Check; import com.djrapitops.plugin.api.TimeAmount; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.task.ITask; +import com.djrapitops.plugin.task.RunnableFactory; /** * TaskSystem responsible for registering tasks for Bukkit. @@ -24,11 +26,14 @@ public class BukkitTaskSystem extends TaskSystem { private ITask bootAnalysisTask; + private final Plan plugin; + public BukkitTaskSystem(Plan plugin) { tpsCountTimer = Check.isPaperAvailable() ? new PaperTPSCountTimer(plugin) : new BukkitTPSCountTimer(plugin); + this.plugin = plugin; } @Override @@ -39,7 +44,6 @@ public class BukkitTaskSystem extends TaskSystem { private void registerTasks() { Benchmark.start("Task Registration"); - // Analysis refresh settings int analysisRefreshMinutes = Settings.ANALYSIS_AUTO_REFRESH.getNumber(); boolean analysisRefreshTaskIsEnabled = analysisRefreshMinutes > 0; @@ -54,12 +58,18 @@ public class BukkitTaskSystem extends TaskSystem { if (analysisRefreshTaskIsEnabled) { registerTask(new PeriodicAnalysisTask()).runTaskTimerAsynchronously(analysisPeriod, analysisPeriod); } + if (Settings.ANALYSIS_EXPORT.isTrue()) { + RunnableFactory.createNew(new HtmlExport(plugin)).runTaskAsynchronously(); + } Benchmark.stop("Enable", "Task Registration"); } public void cancelBootAnalysis() { try { - bootAnalysisTask.cancel(); + if (bootAnalysisTask != null) { + bootAnalysisTask.cancel(); + bootAnalysisTask = null; + } } catch (Exception ignored) { /* Ignored */ } diff --git a/Plan/src/main/java/com/djrapitops/plan/system/tasks/bukkit/BootAnalysisTask.java b/Plan/src/main/java/com/djrapitops/plan/system/tasks/bukkit/BootAnalysisTask.java index 2f7186f3d..a3f13e6ab 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/tasks/bukkit/BootAnalysisTask.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/tasks/bukkit/BootAnalysisTask.java @@ -1,11 +1,11 @@ package com.djrapitops.plan.system.tasks.bukkit; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.connection.WebExceptionLogger; import com.djrapitops.plan.system.info.request.GenerateAnalysisPageRequest; import com.djrapitops.plan.system.info.server.ServerInfo; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.analysis.Analysis; import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.task.AbsRunnable; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java index 71197d95a..fc6470315 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java @@ -1,11 +1,11 @@ package com.djrapitops.plan.system.webserver; import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.SubSystem; import com.djrapitops.plan.system.file.FileSystem; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.html.HtmlUtils; import com.djrapitops.plugin.StaticHolder; import com.djrapitops.plugin.api.Check; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServerSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServerSystem.java index fd781cd84..7d22df88c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServerSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/WebServerSystem.java @@ -7,8 +7,11 @@ package com.djrapitops.plan.system.webserver; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.SubSystem; +import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.webserver.response.cache.ResponseCache; +import com.djrapitops.plugin.api.Benchmark; import com.djrapitops.plugin.api.Check; +import com.djrapitops.plugin.api.utility.log.Log; /** * WebServer subsystem for managing WebServer initialization. @@ -34,10 +37,19 @@ public class WebServerSystem implements SubSystem { @Override public void enable() throws EnableException { + Benchmark.start("WebServer Initialization"); webServer.initServer(); - if (Check.isBungeeAvailable() && !webServer.isEnabled()) { - throw new EnableException("WebServer did not initialize!"); + if (!webServer.isEnabled()) { + if (Check.isBungeeAvailable()) { + throw new EnableException("WebServer did not initialize!"); + } + if (Settings.WEBSERVER_DISABLED.isTrue()) { + Log.warn("WebServer was not initialized. (WebServer.DisableWebServer: true)"); + } else { + Log.error("WebServer was not initialized successfully. Is the port (" + Settings.WEBSERVER_PORT.getNumber() + ") in use?"); + } } + Benchmark.stop("Enable", "WebServer Initialization"); ResponseHandler responseHandler = webServer.getResponseHandler(); responseHandler.registerWebAPIPages(); responseHandler.registerDefaultPages(); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java index 3eff784fa..19914b687 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java @@ -11,12 +11,12 @@ import com.djrapitops.plan.data.container.Action; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.element.ActivityIndex; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plan.utilities.analysis.AnalysisUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/NetworkPage.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/NetworkPage.java index 21d8bbf79..2f88f48e9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/NetworkPage.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/NetworkPage.java @@ -8,11 +8,11 @@ import com.djrapitops.plan.api.exceptions.ParseException; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.container.TPS; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.system.update.VersionCheckSystem; import com.djrapitops.plan.system.webserver.response.cache.PageId; import com.djrapitops.plan.system.webserver.response.cache.ResponseCache; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/CSSResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/CSSResponse.java index a58e24e9f..f381dff85 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/CSSResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/CSSResponse.java @@ -1,6 +1,6 @@ package com.djrapitops.plan.system.webserver.response; -import com.djrapitops.plan.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.Theme; /** * @author Rsl1122 diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/JavaScriptResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/JavaScriptResponse.java index e9e15ad0d..884df375a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/JavaScriptResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/JavaScriptResponse.java @@ -1,7 +1,7 @@ package com.djrapitops.plan.system.webserver.response; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import org.apache.commons.lang3.text.StrSubstitutor; import java.util.HashMap; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/errors/ErrorResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/errors/ErrorResponse.java index e6357e6c9..47bfdb8fe 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/errors/ErrorResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/errors/ErrorResponse.java @@ -4,7 +4,7 @@ */ package com.djrapitops.plan.system.webserver.response.errors; -import com.djrapitops.plan.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.Theme; import com.djrapitops.plan.system.webserver.response.Response; import com.djrapitops.plan.utilities.MiscUtils; import com.djrapitops.plan.utilities.file.FileUtil; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java index 8cb5d33f7..a1f763736 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java @@ -11,6 +11,7 @@ import com.djrapitops.plan.system.database.databases.sql.SQLDB; import com.djrapitops.plan.system.info.connection.ConnectionLog; import com.djrapitops.plan.system.info.server.BungeeServerInfo; import com.djrapitops.plan.system.info.server.Server; +import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.info.server.ServerProperties; import com.djrapitops.plan.system.webserver.response.errors.ErrorResponse; import com.djrapitops.plan.utilities.FormatUtils; @@ -99,7 +100,7 @@ public class DebugPageResponse extends ErrorResponse { private void appendServerInformation(StringBuilder content) { PlanPlugin plugin = PlanPlugin.getInstance(); - ServerProperties variable = plugin.getVariable(); + ServerProperties variable = ServerInfo.getServerProperties(); content.append("
### Server Information
") .append("**Plan Version:** ").append(plugin.getVersion()).append("
"); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/InspectPageResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/InspectPageResponse.java index ddaa591b1..f91eba490 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/InspectPageResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/InspectPageResponse.java @@ -1,6 +1,6 @@ package com.djrapitops.plan.system.webserver.response.pages; -import com.djrapitops.plan.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.Theme; import com.djrapitops.plan.system.webserver.response.Response; import com.djrapitops.plan.system.webserver.response.cache.PageId; import com.djrapitops.plan.system.webserver.response.cache.ResponseCache; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/PlayersPageResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/PlayersPageResponse.java index e0e420dc5..fe454d71c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/PlayersPageResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/PlayersPageResponse.java @@ -6,10 +6,10 @@ import com.djrapitops.plan.data.container.GeoInfo; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.container.UserInfo; import com.djrapitops.plan.data.element.TableContainer; -import com.djrapitops.plan.settings.theme.Theme; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.theme.Theme; import com.djrapitops.plan.system.webserver.response.Response; import com.djrapitops.plan.system.webserver.response.errors.InternalErrorResponse; import com.djrapitops.plan.utilities.FormatUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/bukkit/ConfigurationWebAPI.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/bukkit/ConfigurationWebAPI.java index bf2028abe..80648ed64 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/bukkit/ConfigurationWebAPI.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/bukkit/ConfigurationWebAPI.java @@ -8,7 +8,7 @@ import com.djrapitops.plan.Plan; import com.djrapitops.plan.PlanBungee; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.exceptions.connection.WebException; -import com.djrapitops.plan.settings.ServerSpecificSettings; +import com.djrapitops.plan.system.settings.ServerSpecificSettings; import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.settings.config.ConfigSystem; import com.djrapitops.plan.system.webserver.response.Response; 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 bdfea7f51..2e08101a9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/MiscUtils.java @@ -3,11 +3,11 @@ package com.djrapitops.plan.utilities; import com.djrapitops.plan.Plan; import com.djrapitops.plan.PlanBungee; import com.djrapitops.plan.api.exceptions.database.DBException; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.settings.Permissions; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plugin.api.Check; import com.djrapitops.plugin.api.TimeAmount; import com.djrapitops.plugin.api.utility.log.Log; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java index 9dfbedd80..077b5f2be 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java @@ -8,13 +8,13 @@ import com.djrapitops.plan.data.element.AnalysisContainer; import com.djrapitops.plan.data.plugin.BanData; import com.djrapitops.plan.data.plugin.HookHandler; import com.djrapitops.plan.data.plugin.PluginData; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.cache.DataCache; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.system.tasks.BukkitTaskSystem; import com.djrapitops.plan.system.tasks.TaskSystem; import com.djrapitops.plan.utilities.MiscUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/LocaleEntryComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/LocaleEntryComparator.java index c9614867c..eb16cf4e0 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/LocaleEntryComparator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/LocaleEntryComparator.java @@ -1,7 +1,7 @@ package com.djrapitops.plan.utilities.comparators; -import com.djrapitops.plan.settings.locale.Message; -import com.djrapitops.plan.settings.locale.Msg; +import com.djrapitops.plan.system.settings.locale.Message; +import com.djrapitops.plan.system.settings.locale.Msg; import java.util.Comparator; import java.util.Map; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/file/export/HtmlExport.java b/Plan/src/main/java/com/djrapitops/plan/utilities/file/export/HtmlExport.java index 58a1c471c..445fab3cb 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/file/export/HtmlExport.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/file/export/HtmlExport.java @@ -7,10 +7,10 @@ package com.djrapitops.plan.utilities.file.export; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.data.container.UserInfo; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.database.databases.Database; import com.djrapitops.plan.system.info.connection.ConnectionSystem; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.system.webserver.response.pages.PlayersPageResponse; import com.djrapitops.plan.system.webserver.webapi.bungee.PostHtmlWebAPI; import com.djrapitops.plan.utilities.file.FileUtil; 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 449ac36e7..9112bef4a 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 @@ -1,6 +1,6 @@ package com.djrapitops.plan.utilities.html; -import com.djrapitops.plan.PlanPlugin; +import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.settings.Settings; import org.apache.commons.lang3.text.StrSubstitutor; @@ -43,7 +43,7 @@ public class HtmlUtils { if (Settings.SHOW_ALTERNATIVE_IP.isTrue()) { ip = Settings.ALTERNATIVE_IP.toString().replace("%port%", String.valueOf(port)); } else { - ip = PlanPlugin.getInstance().getVariable().getIp() + ":" + port; + ip = ServerInfo.getServerProperties().getIp() + ":" + port; } return ip; } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java index 3da25c368..fdc094993 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java @@ -5,8 +5,8 @@ package com.djrapitops.plan.utilities.html.graphs; import com.djrapitops.plan.data.element.ActivityIndex; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.FormatUtils; import java.util.Map; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/ActivityPie.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/ActivityPie.java index 7c6e41a18..28fafff13 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/ActivityPie.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/ActivityPie.java @@ -5,8 +5,8 @@ package com.djrapitops.plan.utilities.html.graphs.pie; import com.djrapitops.plan.data.element.ActivityIndex; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import java.util.*; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/WorldPie.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/WorldPie.java index ac6e9c76f..79e5d0b84 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/WorldPie.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/pie/WorldPie.java @@ -2,10 +2,10 @@ package com.djrapitops.plan.utilities.html.graphs.pie; import com.djrapitops.plan.data.time.GMTimes; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.WorldAliasSettings; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.WorldAliasSettings; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.comparators.PieSliceComparator; import java.util.*; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java index 2c09a0dc3..96a563437 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java @@ -7,8 +7,8 @@ package com.djrapitops.plan.utilities.html.structure; import com.djrapitops.plan.data.PlayerProfile; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.analysis.AnalysisUtils; import com.djrapitops.plan.utilities.analysis.MathUtils; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java index 2ce5ad852..2b0ecb676 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java @@ -7,10 +7,10 @@ package com.djrapitops.plan.utilities.html.structure; import com.djrapitops.plan.api.PlanAPI; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.theme.Theme; -import com.djrapitops.plan.settings.theme.ThemeVal; import com.djrapitops.plan.system.cache.DataCache; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.theme.Theme; +import com.djrapitops.plan.system.settings.theme.ThemeVal; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.analysis.AnalysisUtils; import com.djrapitops.plan.utilities.html.Html; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/KillsTableCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/KillsTableCreator.java index 0ce175848..7a8b208bc 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/KillsTableCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/KillsTableCreator.java @@ -2,9 +2,9 @@ package com.djrapitops.plan.utilities.html.tables; import com.djrapitops.plan.api.PlanAPI; import com.djrapitops.plan.data.container.PlayerKill; -import com.djrapitops.plan.settings.locale.Locale; -import com.djrapitops.plan.settings.locale.Msg; import com.djrapitops.plan.system.cache.DataCache; +import com.djrapitops.plan.system.settings.locale.Locale; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.comparators.KillDataComparator; import com.djrapitops.plan.utilities.html.Html; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/SessionsTableCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/SessionsTableCreator.java index 5ce1ef7ce..411145da5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/SessionsTableCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/SessionsTableCreator.java @@ -7,10 +7,10 @@ package com.djrapitops.plan.utilities.html.tables; import com.djrapitops.plan.api.PlanAPI; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.time.WorldTimes; -import com.djrapitops.plan.settings.WorldAliasSettings; import com.djrapitops.plan.system.cache.DataCache; import com.djrapitops.plan.system.cache.SessionCache; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.WorldAliasSettings; import com.djrapitops.plan.utilities.FormatUtils; import com.djrapitops.plan.utilities.comparators.SessionStartComparator; import com.djrapitops.plan.utilities.html.Html; diff --git a/Plan/test/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java b/Plan/test/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java index 3808ab93a..50bb90947 100644 --- a/Plan/test/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java +++ b/Plan/test/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java @@ -4,8 +4,8 @@ import com.djrapitops.plan.data.WebUser; import com.djrapitops.plan.data.container.Session; import com.djrapitops.plan.data.container.TPS; import com.djrapitops.plan.data.container.UserInfo; -import com.djrapitops.plan.settings.locale.Message; -import com.djrapitops.plan.settings.locale.Msg; +import com.djrapitops.plan.system.settings.locale.Message; +import com.djrapitops.plan.system.settings.locale.Msg; import com.djrapitops.plan.utilities.PassEncryptUtil; import com.djrapitops.plan.utilities.analysis.Point; import com.google.common.collect.Ordering; diff --git a/Plan/test/main/java/test/utilities/TestInit.java b/Plan/test/main/java/test/utilities/TestInit.java index 28dd993cb..d8f4fef0e 100644 --- a/Plan/test/main/java/test/utilities/TestInit.java +++ b/Plan/test/main/java/test/utilities/TestInit.java @@ -1,11 +1,11 @@ package test.utilities; import com.djrapitops.plan.Plan; -import com.djrapitops.plan.settings.locale.Locale; import com.djrapitops.plan.system.info.server.BukkitServerInfo; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.info.server.ServerProperties; import com.djrapitops.plan.system.settings.Settings; +import com.djrapitops.plan.system.settings.locale.Locale; import com.djrapitops.plan.utilities.file.FileUtil; import com.djrapitops.plugin.IPlugin; import com.djrapitops.plugin.StaticHolder; @@ -121,7 +121,7 @@ public class TestInit { ServerProperties serverProperties = new ServerProperties(mockServer); - when(planMock.getVariable()).thenReturn(serverProperties); +// when(planMock.getVariable()).thenReturn(serverProperties); BukkitServerInfo bukkitServerInfo = PowerMockito.mock(BukkitServerInfo.class); // DataCache dataCache = new DataCache(planMock) { @@ -134,7 +134,6 @@ public class TestInit { when(ServerInfo.getServerUUID()).thenReturn(serverUUID); when(planMock.getServerUuid()).thenReturn(serverUUID); - when(planMock.getServerInfoManager()).thenReturn(bukkitServerInfo); ColorScheme cs = new ColorScheme(ChatColor.BLACK, ChatColor.BLACK, ChatColor.BLACK, ChatColor.BLACK); when(planMock.getColorScheme()).thenReturn(cs); initLocale(null);