aboutsummaryrefslogtreecommitdiff
path: root/spark-nukkit
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-04-07 11:51:03 +0100
committerLuck <git@lucko.me>2021-04-07 11:51:03 +0100
commit9228cf8b55dc34a5f49bddfe4637fbd4dd7fecb5 (patch)
treea2e153c4d723216f95c49153d5afef524dea9531 /spark-nukkit
parentbb3046600f1d1a98a69f918dd59dff64e051480b (diff)
downloadspark-9228cf8b55dc34a5f49bddfe4637fbd4dd7fecb5.tar.gz
spark-9228cf8b55dc34a5f49bddfe4637fbd4dd7fecb5.tar.bz2
spark-9228cf8b55dc34a5f49bddfe4637fbd4dd7fecb5.zip
Add a basic API for retrieving spark statistics
Diffstat (limited to 'spark-nukkit')
-rw-r--r--spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java
index eb783fa..9606614 100644
--- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java
+++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java
@@ -20,6 +20,7 @@
package me.lucko.spark.nukkit;
+import me.lucko.spark.api.Spark;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.SparkPlugin;
import me.lucko.spark.common.platform.PlatformInfo;
@@ -27,6 +28,7 @@ import me.lucko.spark.common.platform.PlatformInfo;
import cn.nukkit.command.Command;
import cn.nukkit.command.CommandSender;
import cn.nukkit.plugin.PluginBase;
+import cn.nukkit.plugin.service.ServicePriority;
import cn.nukkit.scheduler.AsyncTask;
import java.nio.file.Path;
@@ -89,4 +91,9 @@ public class NukkitSparkPlugin extends PluginBase implements SparkPlugin {
public PlatformInfo getPlatformInfo() {
return new NukkitPlatformInfo(getServer());
}
+
+ @Override
+ public void registerApi(Spark api) {
+ getServer().getServiceManager().register(Spark.class, api, this, ServicePriority.NORMAL);
+ }
}