From 9228cf8b55dc34a5f49bddfe4637fbd4dd7fecb5 Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 7 Apr 2021 11:51:03 +0100 Subject: Add a basic API for retrieving spark statistics --- .../src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spark-nukkit/src/main/java/me/lucko') 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); + } } -- cgit