aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java
diff options
context:
space:
mode:
authorembeddedt <42941056+embeddedt@users.noreply.github.com>2022-12-26 18:58:46 -0500
committerembeddedt <42941056+embeddedt@users.noreply.github.com>2022-12-26 18:58:46 -0500
commit1075665def4a41cf0064255a6da1d1a652f5d473 (patch)
tree11bba64e8f28ce8b83adc05252b75f17e2ccbf6a /spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java
parentd9550259c1995d21fc345c58f2e531fdecf75acd (diff)
parentd9655c40c02aef137c7a6a00a1cc90a1e6fb08d1 (diff)
downloadspark-1075665def4a41cf0064255a6da1d1a652f5d473.tar.gz
spark-1075665def4a41cf0064255a6da1d1a652f5d473.tar.bz2
spark-1075665def4a41cf0064255a6da1d1a652f5d473.zip
Merge remote-tracking branch 'lucko/master' into forge-1.7.10
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java b/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java
index 1116b04..b7aef2a 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java
@@ -23,15 +23,19 @@ package me.lucko.spark.common;
import me.lucko.spark.api.Spark;
import me.lucko.spark.common.command.sender.CommandSender;
import me.lucko.spark.common.monitor.ping.PlayerPingProvider;
+import me.lucko.spark.common.platform.MetadataProvider;
import me.lucko.spark.common.platform.PlatformInfo;
import me.lucko.spark.common.platform.serverconfig.ServerConfigProvider;
import me.lucko.spark.common.platform.world.WorldInfoProvider;
import me.lucko.spark.common.sampler.ThreadDumper;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.SourceMetadata;
import me.lucko.spark.common.tick.TickHook;
import me.lucko.spark.common.tick.TickReporter;
-import me.lucko.spark.common.util.ClassSourceLookup;
import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
import java.util.logging.Level;
import java.util.stream.Stream;
@@ -133,6 +137,15 @@ public interface SparkPlugin {
}
/**
+ * Gets a list of known sources (plugins/mods) on the platform.
+ *
+ * @return a list of sources
+ */
+ default Collection<SourceMetadata> getKnownSources() {
+ return Collections.emptyList();
+ }
+
+ /**
* Creates a player ping provider function.
*
* <p>Returns {@code null} if the platform does not support querying player pings</p>
@@ -149,7 +162,16 @@ public interface SparkPlugin {
* @return the server config provider function
*/
default ServerConfigProvider createServerConfigProvider() {
- return ServerConfigProvider.NO_OP;
+ return null;
+ }
+
+ /**
+ * Creates a metadata provider for the platform.
+ *
+ * @return the platform extra metadata provider
+ */
+ default MetadataProvider createExtraMetadataProvider() {
+ return null;
}
/**