diff options
author | Luck <git@lucko.me> | 2018-12-31 18:15:39 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2018-12-31 18:15:39 +0000 |
commit | 9bed6177ddf94f67aaad5ee2504721cf0b957a94 (patch) | |
tree | a830407555e458bc02f220b09b4b40386321eb9c /spark-velocity | |
parent | 66a8afab99efb7ac7669961eb2e67e2244d494e5 (diff) | |
download | spark-9bed6177ddf94f67aaad5ee2504721cf0b957a94.tar.gz spark-9bed6177ddf94f67aaad5ee2504721cf0b957a94.tar.bz2 spark-9bed6177ddf94f67aaad5ee2504721cf0b957a94.zip |
Add '/spark heapdump' command
Diffstat (limited to 'spark-velocity')
-rw-r--r-- | spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java index 8cc10e1..cf5ed79 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java @@ -26,6 +26,7 @@ import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.plugin.Plugin; +import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ProxyServer; @@ -39,6 +40,8 @@ import net.kyori.text.event.ClickEvent; import net.kyori.text.format.TextColor; import net.kyori.text.serializer.ComponentSerializers; +import java.nio.file.Path; + @Plugin( id = "spark", name = "spark", @@ -49,6 +52,7 @@ import net.kyori.text.serializer.ComponentSerializers; public class SparkVelocityPlugin { private final ProxyServer proxy; + private final Path configDirectory; private final SparkPlatform<CommandSource> sparkPlatform = new SparkPlatform<CommandSource>() { @SuppressWarnings("deprecation") @@ -71,6 +75,11 @@ public class SparkVelocityPlugin { } @Override + public Path getPluginFolder() { + return SparkVelocityPlugin.this.configDirectory; + } + + @Override public String getLabel() { return "sparkv"; } @@ -111,8 +120,9 @@ public class SparkVelocityPlugin { }; @Inject - public SparkVelocityPlugin(ProxyServer proxy) { + public SparkVelocityPlugin(ProxyServer proxy, @DataDirectory Path configDirectory) { this.proxy = proxy; + this.configDirectory = configDirectory; } @Subscribe(order = PostOrder.FIRST) |