aboutsummaryrefslogtreecommitdiff
path: root/spark-minestom
diff options
context:
space:
mode:
Diffstat (limited to 'spark-minestom')
-rw-r--r--spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomClassSourceLookup.java2
-rw-r--r--spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomSparkPlugin.java14
2 files changed, 14 insertions, 2 deletions
diff --git a/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomClassSourceLookup.java b/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomClassSourceLookup.java
index 252060e..ca44eea 100644
--- a/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomClassSourceLookup.java
+++ b/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomClassSourceLookup.java
@@ -20,7 +20,7 @@
package me.lucko.spark.minestom;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import net.minestom.server.MinecraftServer;
import net.minestom.server.extensions.Extension;
diff --git a/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomSparkPlugin.java b/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomSparkPlugin.java
index 2b43cae..9014476 100644
--- a/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomSparkPlugin.java
+++ b/spark-minestom/src/main/java/me/lucko/spark/minestom/MinestomSparkPlugin.java
@@ -24,9 +24,10 @@ import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.SparkPlugin;
import me.lucko.spark.common.monitor.ping.PlayerPingProvider;
import me.lucko.spark.common.platform.PlatformInfo;
+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 net.minestom.server.MinecraftServer;
import net.minestom.server.command.CommandSender;
@@ -45,6 +46,7 @@ import org.jetbrains.annotations.NotNull;
import java.nio.file.Path;
import java.util.Arrays;
+import java.util.Collection;
import java.util.logging.Level;
import java.util.stream.Stream;
@@ -118,6 +120,16 @@ public class MinestomSparkPlugin extends Extension implements SparkPlugin {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ MinecraftServer.getExtensionManager().getExtensions(),
+ extension -> extension.getOrigin().getName(),
+ extension -> extension.getOrigin().getVersion(),
+ extension -> String.join(", ", extension.getOrigin().getAuthors())
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
return new MinestomPlayerPingProvider();
}