aboutsummaryrefslogtreecommitdiff
path: root/spark-bukkit/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'spark-bukkit/src/main')
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitClassSourceLookup.java2
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java16
2 files changed, 16 insertions, 2 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitClassSourceLookup.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitClassSourceLookup.java
index 6d8afda..f9c0c0b 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitClassSourceLookup.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitClassSourceLookup.java
@@ -20,7 +20,7 @@
package me.lucko.spark.bukkit;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import org.bukkit.plugin.java.JavaPlugin;
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
index 5737d3d..87490ea 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
@@ -30,9 +30,10 @@ 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 net.kyori.adventure.platform.bukkit.BukkitAudiences;
@@ -40,10 +41,13 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
+import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;
import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import java.util.stream.Stream;
@@ -181,6 +185,16 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ Arrays.asList(getServer().getPluginManager().getPlugins()),
+ Plugin::getName,
+ plugin -> plugin.getDescription().getVersion(),
+ plugin -> String.join(", ", plugin.getDescription().getAuthors())
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
if (BukkitPlayerPingProvider.isSupported()) {
return new BukkitPlayerPingProvider(getServer());