diff --git a/Plan/dependency-reduced-pom.xml b/Plan/dependency-reduced-pom.xml
index 4441b3970..1112e4a87 100644
--- a/Plan/dependency-reduced-pom.xml
+++ b/Plan/dependency-reduced-pom.xml
@@ -36,7 +36,17 @@
com.google.dagger
dagger-compiler
- 2.16
+ 2.17
+
+
+ com.velocitypowered
+ velocity-api
+ 1.0-SNAPSHOT
+
+
+ org.spongepowered
+ spongeapi
+ 7.1.0
@@ -66,6 +76,7 @@
org.mockito:*
org.easymock:*
junit:*
+ org.slf4j:*
@@ -88,10 +99,6 @@
com.zaxxer
plan.com.zaxxer
-
- org.slf4j
- plan.org.slf4j
-
org.bstats
com.djrapitops.plan.utilities.metrics
@@ -339,7 +346,7 @@
org.spongepowered
spongeapi
- 7.0.0
+ 7.1.0
provided
@@ -356,15 +363,15 @@
configurate-hocon
- ninja.leaping.configurate
+ org.spongepowered
configurate-gson
- ninja.leaping.configurate
+ org.spongepowered
configurate-yaml
- ninja.leaping.configurate
+ org.spongepowered
flow-math
@@ -402,6 +409,12 @@
0.3.8-SNAPSHOT
provided
+
+ org.slf4j
+ slf4j-nop
+ 1.7.25
+ runtime
+
org.mockito
mockito-core
diff --git a/Plan/pom.xml b/Plan/pom.xml
index 09de51fe9..67f40022b 100644
--- a/Plan/pom.xml
+++ b/Plan/pom.xml
@@ -95,7 +95,7 @@
org.spongepowered
spongeapi
- 7.0.0
+ 7.1.0
jar
provided
@@ -202,7 +202,7 @@
com.google.dagger
dagger
- 2.16
+ 2.17
@@ -238,7 +238,17 @@
com.google.dagger
dagger-compiler
- 2.16
+ 2.17
+
+
+ com.velocitypowered
+ velocity-api
+ 1.0-SNAPSHOT
+
+
+ org.spongepowered
+ spongeapi
+ 7.1.0
@@ -269,7 +279,7 @@
org.mockito:*
org.easymock:*
junit:*
-
+ org.slf4j:*
@@ -292,10 +302,10 @@
com.zaxxer
plan.com.zaxxer
-
- org.slf4j
- plan.org.slf4j
-
+
+
+
+
org.bstats
com.djrapitops.plan.utilities.metrics
diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java b/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java
index a6e8226dd..7c29fb8cf 100644
--- a/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java
+++ b/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java
@@ -13,12 +13,14 @@ import com.djrapitops.plan.system.settings.theme.PlanColorScheme;
import com.djrapitops.plugin.VelocityPlugin;
import com.djrapitops.plugin.command.ColorScheme;
import com.djrapitops.plugin.logging.L;
+import com.velocitypowered.api.event.Subscribe;
+import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
+import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import org.slf4j.Logger;
-import java.io.File;
import java.io.InputStream;
import java.nio.file.Path;
@@ -29,23 +31,31 @@ import java.nio.file.Path;
*
* @author MicleBrick
*/
-@Plugin(id = "plan", name = "Plan", version = "4.4.6", description = "Player Analytics Plugin by Rsl1122", authors = {"Rsl1122"})
+@Plugin(
+ id = "plan",
+ name = "Plan",
+ version = "4.4.6",
+ description = "Player Analytics Plugin by Rsl1122",
+ authors = {"Rsl1122"}
+)
public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
private PlanSystem system;
private Locale locale;
@com.google.inject.Inject
- @DataDirectory
- private Path dataFolderPath;
- @com.google.inject.Inject
- private ProxyServer proxy;
- @com.google.inject.Inject
- private Logger slf4jLogger;
+ public PlanVelocity(ProxyServer proxy, Logger slf4jLogger, @DataDirectory Path dataFolderPath) {
+ super(proxy, slf4jLogger, dataFolderPath);
+ }
- @Override
- public File getDataFolder() {
- return dataFolderPath.toFile();
+ @Subscribe
+ public void onProxyStart(ProxyInitializeEvent event) {
+ onEnable();
+ }
+
+ @Subscribe
+ public void onProxyShutdown(ProxyShutdownEvent event) {
+ onDisable();
}
@Override
@@ -63,11 +73,11 @@ public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
logger.error("----------------------------------------");
logger.error("Error: " + e.getMessage());
logger.error("----------------------------------------");
- logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planbungee reload");
+ logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planvelocity reload");
onDisable();
} catch (Exception e) {
errorHandler.log(L.CRITICAL, this.getClass(), e);
- logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planbungee reload");
+ logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planvelocity reload");
logger.error("This error should be reported at https://github.com/Rsl1122/Plan-PlayerAnalytics/issues");
onDisable();
}
@@ -80,7 +90,7 @@ public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
public void onDisable() {
system.disable();
- slf4jLogger.info(locale.getString(PluginLang.DISABLED));
+ logger.info(locale.getString(PluginLang.DISABLED));
}
@Override
@@ -90,7 +100,7 @@ public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
@Override
public InputStream getResource(String resource) {
- return getClass().getResourceAsStream(resource);
+ return getClass().getResourceAsStream("/" + resource);
}
@Override
@@ -107,14 +117,4 @@ public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
public boolean isReloading() {
return reloading;
}
-
- @Override
- public ProxyServer getProxy() {
- return proxy;
- }
-
- @Override
- protected Logger getLogger() {
- return slf4jLogger;
- }
}