aboutsummaryrefslogtreecommitdiff
path: root/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.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-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.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-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java')
-rw-r--r--spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java
index 83b2ec2..b1d31e9 100644
--- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java
+++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8SparkPlugin.java
@@ -30,8 +30,9 @@ import me.lucko.spark.common.monitor.ping.PlayerPingProvider;
import me.lucko.spark.common.platform.PlatformInfo;
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.util.ClassSourceLookup;
import net.kyori.adventure.text.Component;
@@ -52,8 +53,10 @@ import org.spongepowered.api.event.lifecycle.StartedEngineEvent;
import org.spongepowered.api.event.lifecycle.StoppingEngineEvent;
import org.spongepowered.plugin.PluginContainer;
import org.spongepowered.plugin.builtin.jvm.Plugin;
+import org.spongepowered.plugin.metadata.model.PluginContributor;
import java.nio.file.Path;
+import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
@@ -178,6 +181,18 @@ public class Sponge8SparkPlugin implements SparkPlugin {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ this.game.pluginManager().plugins(),
+ plugin -> plugin.metadata().id(),
+ plugin -> plugin.metadata().version().toString(),
+ plugin -> plugin.metadata().contributors().stream()
+ .map(PluginContributor::name)
+ .collect(Collectors.joining(", "))
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
if (this.game.isServerAvailable()) {
return new Sponge8PlayerPingProvider(this.game.server());