aboutsummaryrefslogtreecommitdiff
path: root/spark-velocity4
diff options
context:
space:
mode:
Diffstat (limited to 'spark-velocity4')
-rw-r--r--spark-velocity4/build.gradle3
-rw-r--r--spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4ClassSourceLookup.java4
-rw-r--r--spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4SparkPlugin.java14
3 files changed, 15 insertions, 6 deletions
diff --git a/spark-velocity4/build.gradle b/spark-velocity4/build.gradle
index 5bef80b..1f8e8ee 100644
--- a/spark-velocity4/build.gradle
+++ b/spark-velocity4/build.gradle
@@ -31,11 +31,8 @@ shadowJar {
exclude(dependency('net.kyori:^(?!adventure-text-feature-pagination).+$'))
}
- relocate 'okio', 'me.lucko.spark.lib.okio'
- relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3'
relocate 'net.kyori.adventure.text.feature.pagination', 'me.lucko.spark.lib.adventure.pagination'
relocate 'net.bytebuddy', 'me.lucko.spark.lib.bytebuddy'
- relocate 'org.tukaani.xz', 'me.lucko.spark.lib.xz'
relocate 'com.google.protobuf', 'me.lucko.spark.lib.protobuf'
relocate 'org.objectweb.asm', 'me.lucko.spark.lib.asm'
relocate 'one.profiler', 'me.lucko.spark.lib.asyncprofiler'
diff --git a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4ClassSourceLookup.java b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4ClassSourceLookup.java
index c5c22c3..84840d2 100644
--- a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4ClassSourceLookup.java
+++ b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4ClassSourceLookup.java
@@ -23,7 +23,7 @@ package me.lucko.spark.velocity;
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.PluginManager;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -48,7 +48,7 @@ public class Velocity4ClassSourceLookup extends ClassSourceLookup.ByClassLoader
for (PluginContainer plugin : pluginManager.plugins()) {
Object instance = plugin.instance();
if (instance != null) {
- this.classLoadersToPlugin.put(instance.getClass().getClassLoader(), plugin.description().name());
+ this.classLoadersToPlugin.put(instance.getClass().getClassLoader(), plugin.description().id());
}
}
}
diff --git a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4SparkPlugin.java b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4SparkPlugin.java
index 0c57689..b638246 100644
--- a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4SparkPlugin.java
+++ b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4SparkPlugin.java
@@ -34,11 +34,13 @@ 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.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.SourceMetadata;
import org.slf4j.Logger;
import java.nio.file.Path;
+import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import java.util.stream.Stream;
@@ -134,6 +136,16 @@ public class Velocity4SparkPlugin implements SparkPlugin, SimpleCommand {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ this.proxy.pluginManager().plugins(),
+ plugin -> plugin.description().id(),
+ plugin -> plugin.description().version(),
+ plugin -> String.join(", ", plugin.description().authors())
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
return new Velocity4PlayerPingProvider(this.proxy);
}