aboutsummaryrefslogtreecommitdiff
path: root/spark-velocity
diff options
context:
space:
mode:
authorlucko <git@lucko.me>2022-12-27 09:17:54 +0000
committerGitHub <noreply@github.com>2022-12-27 09:17:54 +0000
commite5b278047ccb7bc6b301d787474c51d162911867 (patch)
tree11bba64e8f28ce8b83adc05252b75f17e2ccbf6a /spark-velocity
parent4a16a1a2f4eb09f706b4a541e3d31618de29420b (diff)
parent1075665def4a41cf0064255a6da1d1a652f5d473 (diff)
downloadspark-e5b278047ccb7bc6b301d787474c51d162911867.tar.gz
spark-e5b278047ccb7bc6b301d787474c51d162911867.tar.bz2
spark-e5b278047ccb7bc6b301d787474c51d162911867.zip
Merge pull request #284 from embeddedt/forge-1.7.10
Align 1.7.10 with master
Diffstat (limited to 'spark-velocity')
-rw-r--r--spark-velocity/build.gradle3
-rw-r--r--spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityClassSourceLookup.java2
-rw-r--r--spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java14
3 files changed, 14 insertions, 5 deletions
diff --git a/spark-velocity/build.gradle b/spark-velocity/build.gradle
index b2e938b..275d3df 100644
--- a/spark-velocity/build.gradle
+++ b/spark-velocity/build.gradle
@@ -26,11 +26,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-velocity/src/main/java/me/lucko/spark/velocity/VelocityClassSourceLookup.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityClassSourceLookup.java
index bcb8176..9b697c3 100644
--- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityClassSourceLookup.java
+++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityClassSourceLookup.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;
diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java
index 7d9ced8..4a89a4e 100644
--- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java
+++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.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 VelocitySparkPlugin implements SparkPlugin, SimpleCommand {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ this.proxy.getPluginManager().getPlugins(),
+ plugin -> plugin.getDescription().getId(),
+ plugin -> plugin.getDescription().getVersion().orElse("unspecified"),
+ plugin -> String.join(", ", plugin.getDescription().getAuthors())
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
return new VelocityPlayerPingProvider(this.proxy);
}