diff --git a/spark-api/src/main/java/me/lucko/spark/api/Spark.java b/spark-api/src/main/java/me/lucko/spark/api/Spark.java index 653eb536..af71ab6b 100644 --- a/spark-api/src/main/java/me/lucko/spark/api/Spark.java +++ b/spark-api/src/main/java/me/lucko/spark/api/Spark.java @@ -29,7 +29,6 @@ import me.lucko.spark.api.statistic.misc.DoubleAverageInfo; import me.lucko.spark.api.statistic.types.DoubleStatistic; import me.lucko.spark.api.statistic.types.GenericStatistic; - import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.jetbrains.annotations.Unmodifiable; diff --git a/spark-api/src/main/java/me/lucko/spark/api/statistic/types/DoubleStatistic.java b/spark-api/src/main/java/me/lucko/spark/api/statistic/types/DoubleStatistic.java index 50c484e3..e5486e17 100644 --- a/spark-api/src/main/java/me/lucko/spark/api/statistic/types/DoubleStatistic.java +++ b/spark-api/src/main/java/me/lucko/spark/api/statistic/types/DoubleStatistic.java @@ -27,7 +27,6 @@ import me.lucko.spark.api.statistic.Statistic; import me.lucko.spark.api.statistic.StatisticWindow; - import org.checkerframework.checker.nullness.qual.NonNull; /** diff --git a/spark-api/src/main/java/me/lucko/spark/api/statistic/types/GenericStatistic.java b/spark-api/src/main/java/me/lucko/spark/api/statistic/types/GenericStatistic.java index c91801b6..a2d298da 100644 --- a/spark-api/src/main/java/me/lucko/spark/api/statistic/types/GenericStatistic.java +++ b/spark-api/src/main/java/me/lucko/spark/api/statistic/types/GenericStatistic.java @@ -27,7 +27,6 @@ import me.lucko.spark.api.statistic.Statistic; import me.lucko.spark.api.statistic.StatisticWindow; - import org.checkerframework.checker.nullness.qual.NonNull; /** 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 d3b2aa16..e505907c 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 @@ -21,7 +21,6 @@ package me.lucko.spark.bukkit; import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import org.bukkit.plugin.java.JavaPlugin; import java.lang.reflect.Field; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitCommandSender.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitCommandSender.java index df6f6581..11f7e9ec 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitCommandSender.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitCommandSender.java @@ -21,11 +21,9 @@ package me.lucko.spark.bukkit; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.audience.Audience; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.text.Component; - import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java index 2bf17acc..60522f4b 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.bukkit; import me.lucko.spark.common.platform.PlatformInfo; - import org.bukkit.Server; import java.lang.reflect.Field; @@ -44,6 +43,11 @@ public String getName() { return "Bukkit"; } + @Override + public String getBrand() { + return this.server.getName(); + } + @Override public String getVersion() { return this.server.getVersion(); diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlayerPingProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlayerPingProvider.java index 2cf58cf0..988ff9f0 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlayerPingProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.bukkit; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java index 15ec1295..e5181406 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java @@ -20,6 +20,7 @@ package me.lucko.spark.bukkit; +import co.aikar.timings.TimingsManager; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.gson.Gson; @@ -27,19 +28,15 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializer; - import me.lucko.spark.common.platform.serverconfig.ConfigParser; import me.lucko.spark.common.platform.serverconfig.ExcludedConfigFilter; import me.lucko.spark.common.platform.serverconfig.PropertiesConfigParser; import me.lucko.spark.common.platform.serverconfig.ServerConfigProvider; - import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.configuration.MemorySection; import org.bukkit.configuration.file.YamlConfiguration; -import co.aikar.timings.TimingsManager; - import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Files; 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 87490ea2..dc87fce1 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 @@ -34,9 +34,7 @@ import me.lucko.spark.common.sampler.source.SourceMetadata; import me.lucko.spark.common.tick.TickHook; import me.lucko.spark.common.tick.TickReporter; - import net.kyori.adventure.platform.bukkit.BukkitAudiences; - import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickHook.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickHook.java index 6547971b..eb49e0bf 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickHook.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickHook.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitTask; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java index babb0bc7..8d2ea513 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java @@ -23,7 +23,6 @@ import me.lucko.spark.common.platform.world.AbstractChunkInfo; import me.lucko.spark.common.platform.world.CountMap; import me.lucko.spark.common.platform.world.WorldInfoProvider; - import org.bukkit.Chunk; import org.bukkit.Server; import org.bukkit.World; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java index e604321f..9240d9b2 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java @@ -21,7 +21,6 @@ package me.lucko.spark.bukkit; import com.google.common.base.Preconditions; - import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickHook.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickHook.java index 43d5a247..d245623d 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickHook.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickHook.java @@ -21,10 +21,8 @@ package me.lucko.spark.bukkit; import com.destroystokyo.paper.event.server.ServerTickStartEvent; - import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickReporter.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickReporter.java index f4a1ee92..587196e6 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickReporter.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/PaperTickReporter.java @@ -21,10 +21,8 @@ package me.lucko.spark.bukkit; import com.destroystokyo.paper.event.server.ServerTickEndEvent; - import me.lucko.spark.common.tick.AbstractTickReporter; import me.lucko.spark.common.tick.TickReporter; - import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkMVdWPlaceholders.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkMVdWPlaceholders.java index 7fa6e02c..11dadc99 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkMVdWPlaceholders.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkMVdWPlaceholders.java @@ -20,13 +20,12 @@ package me.lucko.spark.bukkit.placeholder; -import me.lucko.spark.bukkit.BukkitSparkPlugin; -import me.lucko.spark.common.SparkPlatform; -import me.lucko.spark.common.util.SparkPlaceholder; - import be.maximvdw.placeholderapi.PlaceholderAPI; import be.maximvdw.placeholderapi.PlaceholderReplaceEvent; import be.maximvdw.placeholderapi.PlaceholderReplacer; +import me.lucko.spark.bukkit.BukkitSparkPlugin; +import me.lucko.spark.common.SparkPlatform; +import me.lucko.spark.common.util.SparkPlaceholder; public class SparkMVdWPlaceholders implements PlaceholderReplacer { private final SparkPlatform platform; diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkPlaceholderApi.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkPlaceholderApi.java index b3919ddd..7c599a75 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkPlaceholderApi.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/placeholder/SparkPlaceholderApi.java @@ -24,7 +24,6 @@ import me.lucko.spark.bukkit.BukkitSparkPlugin; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.util.SparkPlaceholder; - import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordClassSourceLookup.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordClassSourceLookup.java index 2024d54f..b0665fd6 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordClassSourceLookup.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordClassSourceLookup.java @@ -21,7 +21,6 @@ package me.lucko.spark.bungeecord; import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import net.md_5.bungee.api.plugin.PluginDescription; import java.lang.reflect.Field; diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordCommandSender.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordCommandSender.java index 917111a6..51d1a7d5 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordCommandSender.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordCommandSender.java @@ -21,7 +21,6 @@ package me.lucko.spark.bungeecord; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.audience.Audience; import net.kyori.adventure.platform.bungeecord.BungeeAudiences; import net.kyori.adventure.text.Component; diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java index fc5c5886..df8cc8dc 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.bungeecord; import me.lucko.spark.common.platform.PlatformInfo; - import net.md_5.bungee.api.ProxyServer; public class BungeeCordPlatformInfo implements PlatformInfo { @@ -41,6 +40,11 @@ public String getName() { return "BungeeCord"; } + @Override + public String getBrand() { + return this.proxy.getName(); + } + @Override public String getVersion() { return this.proxy.getVersion(); diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlayerPingProvider.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlayerPingProvider.java index 37955a30..fcb3e31a 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlayerPingProvider.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.bungeecord; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java index 71beddb1..038f635e 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java @@ -26,7 +26,6 @@ import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.sampler.source.ClassSourceLookup; import me.lucko.spark.common.sampler.source.SourceMetadata; - import net.kyori.adventure.platform.bungeecord.BungeeAudiences; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Command; diff --git a/spark-common/src/main/java/me/lucko/spark/common/activitylog/Activity.java b/spark-common/src/main/java/me/lucko/spark/common/activitylog/Activity.java index 8b1b558d..0b698269 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/activitylog/Activity.java +++ b/spark-common/src/main/java/me/lucko/spark/common/activitylog/Activity.java @@ -23,7 +23,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; - import me.lucko.spark.common.command.sender.CommandSender; import java.util.concurrent.TimeUnit; diff --git a/spark-common/src/main/java/me/lucko/spark/common/api/AbstractStatistic.java b/spark-common/src/main/java/me/lucko/spark/common/api/AbstractStatistic.java index 49a6ccb0..e7610132 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/api/AbstractStatistic.java +++ b/spark-common/src/main/java/me/lucko/spark/common/api/AbstractStatistic.java @@ -24,7 +24,6 @@ import me.lucko.spark.api.statistic.StatisticWindow; import me.lucko.spark.api.statistic.types.DoubleStatistic; import me.lucko.spark.api.statistic.types.GenericStatistic; - import org.checkerframework.checker.nullness.qual.NonNull; import java.lang.reflect.Array; diff --git a/spark-common/src/main/java/me/lucko/spark/common/api/GarbageCollectorInfo.java b/spark-common/src/main/java/me/lucko/spark/common/api/GarbageCollectorInfo.java index fc14c67f..3dfdab28 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/api/GarbageCollectorInfo.java +++ b/spark-common/src/main/java/me/lucko/spark/common/api/GarbageCollectorInfo.java @@ -22,7 +22,6 @@ import me.lucko.spark.api.gc.GarbageCollector; import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics; - import org.checkerframework.checker.nullness.qual.NonNull; public class GarbageCollectorInfo implements GarbageCollector { diff --git a/spark-common/src/main/java/me/lucko/spark/common/api/SparkApi.java b/spark-common/src/main/java/me/lucko/spark/common/api/SparkApi.java index 9e4eee48..16cb2598 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/api/SparkApi.java +++ b/spark-common/src/main/java/me/lucko/spark/common/api/SparkApi.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.api; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.api.Spark; import me.lucko.spark.api.SparkProvider; import me.lucko.spark.api.gc.GarbageCollector; @@ -32,7 +31,6 @@ import me.lucko.spark.common.monitor.cpu.CpuMonitor; import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics; import me.lucko.spark.common.monitor.tick.TickStatistics; - import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/Command.java b/spark-common/src/main/java/me/lucko/spark/common/command/Command.java index c6871a95..3e87fa6e 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/Command.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/Command.java @@ -21,10 +21,8 @@ package me.lucko.spark.common.command; import com.google.common.collect.ImmutableList; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.command.sender.CommandSender; - import net.kyori.adventure.text.Component; import java.util.Collections; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java b/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java index d1481bd6..c2e82231 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.command.sender.CommandSender; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.JoinConfiguration; import net.kyori.adventure.text.TextComponent; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/ActivityLogModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/ActivityLogModule.java index 6252ac79..c72038bb 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/ActivityLogModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/ActivityLogModule.java @@ -24,7 +24,6 @@ import me.lucko.spark.common.command.Command; import me.lucko.spark.common.command.CommandModule; import me.lucko.spark.common.command.tabcomplete.TabCompleter; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.event.ClickEvent; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/GcMonitoringModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/GcMonitoringModule.java index a2da0a06..1d0c226c 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/GcMonitoringModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/GcMonitoringModule.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.command.modules; import com.sun.management.GarbageCollectionNotificationInfo; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.command.Command; import me.lucko.spark.common.command.CommandModule; @@ -29,7 +28,6 @@ import me.lucko.spark.common.monitor.memory.GarbageCollectionMonitor; import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics; import me.lucko.spark.common.util.FormatUtil; - import net.kyori.adventure.text.Component; import java.lang.management.MemoryUsage; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java index 16eadc8a..15722d73 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java @@ -38,7 +38,6 @@ import me.lucko.spark.common.util.FormatUtil; import me.lucko.spark.common.util.RollingAverage; import me.lucko.spark.common.util.StatisticFormatter; - import net.kyori.adventure.text.Component; import java.lang.management.ManagementFactory; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HeapAnalysisModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HeapAnalysisModule.java index 6ac3b2f1..503e8627 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HeapAnalysisModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HeapAnalysisModule.java @@ -34,7 +34,6 @@ import me.lucko.spark.common.util.FormatUtil; import me.lucko.spark.common.util.MediaTypes; import me.lucko.spark.proto.SparkHeapProtos; - import net.kyori.adventure.text.event.ClickEvent; import java.io.IOException; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/TickMonitoringModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/TickMonitoringModule.java index f5f4fce5..85dfaf1d 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/TickMonitoringModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/TickMonitoringModule.java @@ -28,7 +28,6 @@ import me.lucko.spark.common.monitor.tick.ReportPredicate; import me.lucko.spark.common.monitor.tick.TickMonitor; import me.lucko.spark.common.tick.TickHook; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/sender/CommandSender.java b/spark-common/src/main/java/me/lucko/spark/common/command/sender/CommandSender.java index bae5ddfa..a1df6278 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/sender/CommandSender.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/sender/CommandSender.java @@ -23,9 +23,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; - import me.lucko.spark.proto.SparkProtos.CommandSenderMetadata; - import net.kyori.adventure.text.Component; import java.util.UUID; diff --git a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java index 955bafe9..707adbb3 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java +++ b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDump.java @@ -20,15 +20,14 @@ package me.lucko.spark.common.heapdump; +import javax.management.JMX; +import javax.management.MBeanServer; +import javax.management.ObjectName; import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.reflect.Method; import java.nio.file.Path; -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.ObjectName; - /** * Utility for creating .hprof memory heap snapshots. */ diff --git a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java index eaedd312..c7f4f511 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java +++ b/spark-common/src/main/java/me/lucko/spark/common/heapdump/HeapDumpSummary.java @@ -25,9 +25,11 @@ import me.lucko.spark.proto.SparkHeapProtos.HeapData; import me.lucko.spark.proto.SparkHeapProtos.HeapEntry; import me.lucko.spark.proto.SparkHeapProtos.HeapMetadata; - import org.objectweb.asm.Type; +import javax.management.JMX; +import javax.management.MBeanServer; +import javax.management.ObjectName; import java.lang.management.ManagementFactory; import java.util.Arrays; import java.util.List; @@ -36,10 +38,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.ObjectName; - /** * Represents a "heap dump summary" from the VM. * diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java index b4ab8315..987af7b5 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java @@ -23,13 +23,12 @@ import me.lucko.spark.common.monitor.MonitoringExecutor; import me.lucko.spark.common.util.RollingAverage; -import java.lang.management.ManagementFactory; -import java.math.BigDecimal; -import java.util.concurrent.TimeUnit; - import javax.management.JMX; import javax.management.MBeanServer; import javax.management.ObjectName; +import java.lang.management.ManagementFactory; +import java.math.BigDecimal; +import java.util.concurrent.TimeUnit; /** * Exposes and monitors the system/process CPU usage. diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/GarbageCollectionMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/GarbageCollectionMonitor.java index 9bff1e24..d9abf9b6 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/GarbageCollectionMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/GarbageCollectionMonitor.java @@ -22,16 +22,15 @@ import com.sun.management.GarbageCollectionNotificationInfo; -import java.lang.management.GarbageCollectorMXBean; -import java.lang.management.ManagementFactory; -import java.util.ArrayList; -import java.util.List; - import javax.management.ListenerNotFoundException; import javax.management.Notification; import javax.management.NotificationEmitter; import javax.management.NotificationListener; import javax.management.openmbean.CompositeData; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.List; /** * Monitoring process for garbage collections. diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/MemoryInfo.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/MemoryInfo.java index 8f63f712..b260d7ee 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/MemoryInfo.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/memory/MemoryInfo.java @@ -22,13 +22,12 @@ import me.lucko.spark.common.monitor.LinuxProc; -import java.lang.management.ManagementFactory; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import javax.management.JMX; import javax.management.MBeanServer; import javax.management.ObjectName; +import java.lang.management.ManagementFactory; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Utility to query information about system memory usage. diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/net/NetworkInterfaceInfo.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/net/NetworkInterfaceInfo.java index 332077a4..eed695ec 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/net/NetworkInterfaceInfo.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/net/NetworkInterfaceInfo.java @@ -21,9 +21,7 @@ package me.lucko.spark.common.monitor.net; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.LinuxProc; - import org.checkerframework.checker.nullness.qual.NonNull; import java.util.Arrays; diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/ping/PingStatistics.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/ping/PingStatistics.java index 49fcbe1b..803a1836 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/ping/PingStatistics.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/ping/PingStatistics.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.monitor.MonitoringExecutor; import me.lucko.spark.common.util.RollingAverage; - import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/tick/TickMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/tick/TickMonitor.java index 944fa83e..f9b41f31 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/tick/TickMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/tick/TickMonitor.java @@ -21,11 +21,9 @@ package me.lucko.spark.common.monitor.tick; import com.sun.management.GarbageCollectionNotificationInfo; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.monitor.memory.GarbageCollectionMonitor; import me.lucko.spark.common.tick.TickHook; - import net.kyori.adventure.text.Component; import java.text.DecimalFormat; diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java index 082389d5..1d71d535 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java @@ -30,6 +30,8 @@ public interface PlatformInfo { String getName(); + String getBrand(); + String getVersion(); String getMinecraftVersion(); @@ -40,7 +42,7 @@ default int getSparkVersion() { } default Data toData() { - return new Data(getType(), getName(), getVersion(), getMinecraftVersion(), getSparkVersion()); + return new Data(getType(), getName(), getBrand(), getVersion(), getMinecraftVersion(), getSparkVersion()); } enum Type { @@ -62,13 +64,15 @@ public PlatformMetadata.Type toProto() { final class Data { private final Type type; private final String name; + private final String brand; private final String version; private final String minecraftVersion; private final int sparkVersion; - public Data(Type type, String name, String version, String minecraftVersion, int sparkVersion) { + public Data(Type type, String name, String brand, String version, String minecraftVersion, int sparkVersion) { this.type = type; this.name = name; + this.brand = brand; this.version = version; this.minecraftVersion = minecraftVersion; this.sparkVersion = sparkVersion; @@ -82,6 +86,10 @@ public String getName() { return this.name; } + public String getBrand() { + return this.brand; + } + public String getVersion() { return this.version; } @@ -98,6 +106,7 @@ public PlatformMetadata toProto() { PlatformMetadata.Builder proto = PlatformMetadata.newBuilder() .setType(this.type.toProto()) .setName(this.name) + .setBrand(this.brand) .setVersion(this.version) .setSparkVersion(this.sparkVersion); diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java index 485f2158..6503df9f 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableMap; import com.google.gson.JsonElement; - import me.lucko.spark.common.platform.MetadataProvider; import java.util.Arrays; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java index 5bee56f0..192275bc 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java @@ -23,9 +23,7 @@ import com.google.common.collect.ImmutableTable; import com.google.common.collect.Table; import com.google.common.io.ByteStreams; - import me.lucko.spark.common.SparkPlatform; - import one.profiler.AsyncProfiler; import one.profiler.Events; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerJob.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerJob.java index 2fd304c1..39c4eb20 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerJob.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerJob.java @@ -21,11 +21,9 @@ package me.lucko.spark.common.sampler.async; import com.google.common.collect.ImmutableList; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.sampler.ThreadDumper; import me.lucko.spark.common.sampler.async.jfr.JfrReader; - import one.profiler.AsyncProfiler; import java.io.IOException; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java index 961c3e99..e3470b4b 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.sampler.async; import com.google.common.util.concurrent.ThreadFactoryBuilder; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.sampler.AbstractSampler; import me.lucko.spark.common.sampler.SamplerMode; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/SampleCollector.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/SampleCollector.java index 6054b915..cd3f7503 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/SampleCollector.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/SampleCollector.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.sampler.async; import com.google.common.collect.ImmutableList; - import me.lucko.spark.common.sampler.SamplerMode; import me.lucko.spark.common.sampler.async.AsyncProfilerAccess.ProfilingEvent; import me.lucko.spark.common.sampler.async.jfr.JfrReader.AllocationSample; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/java/JavaSampler.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/java/JavaSampler.java index e29619b5..bae7e190 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/java/JavaSampler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/java/JavaSampler.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.sampler.java; import com.google.common.util.concurrent.ThreadFactoryBuilder; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.sampler.AbstractSampler; import me.lucko.spark.common.sampler.SamplerMode; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/node/StackTraceNode.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/node/StackTraceNode.java index c0dcc5bd..fec71237 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/node/StackTraceNode.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/node/StackTraceNode.java @@ -23,7 +23,6 @@ import me.lucko.spark.common.sampler.window.ProtoTimeEncoder; import me.lucko.spark.common.util.MethodDisambiguator; import me.lucko.spark.proto.SparkSamplerProtos; - import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Objects; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/source/ClassSourceLookup.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/source/ClassSourceLookup.java index ab63c003..a62f8d14 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/source/ClassSourceLookup.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/source/ClassSourceLookup.java @@ -24,7 +24,6 @@ import me.lucko.spark.common.sampler.node.StackTraceNode; import me.lucko.spark.common.sampler.node.ThreadNode; import me.lucko.spark.common.util.ClassFinder; - import org.checkerframework.checker.nullness.qual.Nullable; import java.io.IOException; diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/source/SourceMetadata.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/source/SourceMetadata.java index 0808d660..13dc66d1 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/source/SourceMetadata.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/source/SourceMetadata.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.sampler.source; import com.google.common.collect.ImmutableList; - import me.lucko.spark.proto.SparkSamplerProtos.SamplerMetadata; import java.util.Collection; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/ClassFinder.java b/spark-common/src/main/java/me/lucko/spark/common/util/ClassFinder.java index f132613c..8bc06a86 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/ClassFinder.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/ClassFinder.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.util; import net.bytebuddy.agent.ByteBuddyAgent; - import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.instrument.Instrumentation; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java b/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java index c03e7cb0..2b2e3c78 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/MethodDisambiguator.java @@ -23,9 +23,7 @@ import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; - import me.lucko.spark.common.sampler.node.StackTraceNode; - import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Label; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/SparkPlaceholder.java b/spark-common/src/main/java/me/lucko/spark/common/util/SparkPlaceholder.java index be5bbc28..948d404a 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/SparkPlaceholder.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/SparkPlaceholder.java @@ -23,7 +23,6 @@ import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.monitor.cpu.CpuMonitor; import me.lucko.spark.common.monitor.tick.TickStatistics; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/StatisticFormatter.java b/spark-common/src/main/java/me/lucko/spark/common/util/StatisticFormatter.java index b488f505..e7b8cca2 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/util/StatisticFormatter.java +++ b/spark-common/src/main/java/me/lucko/spark/common/util/StatisticFormatter.java @@ -21,9 +21,7 @@ package me.lucko.spark.common.util; import com.google.common.base.Strings; - import me.lucko.spark.api.statistic.misc.DoubleAverageInfo; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.format.TextColor; diff --git a/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocket.java b/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocket.java index 6a9c2b74..0356b7dc 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocket.java +++ b/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocket.java @@ -21,7 +21,6 @@ package me.lucko.spark.common.ws; import com.google.protobuf.ByteString; - import me.lucko.bytesocks.client.BytesocksClient; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.sampler.AbstractSampler; diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto index 20044155..a70b3c34 100644 --- a/spark-common/src/main/proto/spark/spark.proto +++ b/spark-common/src/main/proto/spark/spark.proto @@ -11,6 +11,7 @@ message PlatformMetadata { string version = 3; string minecraft_version = 4; // optional int32 spark_version = 7; + string brand = 8; // replaced reserved 5, 6; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java index ef22d9c3..bd5385bd 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java @@ -21,16 +21,13 @@ package me.lucko.spark.fabric; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.sampler.source.ClassSourceLookup; import me.lucko.spark.common.util.ClassFinder; import me.lucko.spark.fabric.smap.MixinUtils; import me.lucko.spark.fabric.smap.SourceMap; import me.lucko.spark.fabric.smap.SourceMapProvider; - import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; - import org.objectweb.asm.Type; import org.spongepowered.asm.mixin.FabricUtil; import org.spongepowered.asm.mixin.extensibility.IMixinConfig; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java index 7da89966..64230183 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.command.sender.AbstractCommandSender; import me.lucko.spark.fabric.plugin.FabricSparkPlugin; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.entity.player.PlayerEntity; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricExtraMetadataProvider.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricExtraMetadataProvider.java index 91797bb4..a6f70a66 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricExtraMetadataProvider.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricExtraMetadataProvider.java @@ -22,9 +22,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import me.lucko.spark.common.platform.MetadataProvider; - import net.minecraft.resource.ResourcePackManager; import net.minecraft.resource.ResourcePackProfile; import net.minecraft.resource.ResourcePackSource; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlatformInfo.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlatformInfo.java index e298121e..57251e1f 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlatformInfo.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.fabric; import me.lucko.spark.common.platform.PlatformInfo; - import net.fabricmc.loader.api.FabricLoader; import java.util.Optional; @@ -43,6 +42,13 @@ public String getName() { return "Fabric"; } + @Override + public String getBrand() { + return FabricLoader.getInstance().getModContainer("fabric") + .map(container -> container.getMetadata().getName()) + .orElse("Fabric"); + } + @Override public String getVersion() { return getModVersion("fabricloader").orElse("unknown"); diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlayerPingProvider.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlayerPingProvider.java index fefe284d..42b6b373 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlayerPingProvider.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricPlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.fabric; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java index 325a324d..bc70228d 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; - import me.lucko.spark.common.platform.serverconfig.ConfigParser; import me.lucko.spark.common.platform.serverconfig.PropertiesConfigParser; import me.lucko.spark.common.platform.serverconfig.ServerConfigProvider; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricSparkMod.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricSparkMod.java index ad419f7f..23a518b2 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricSparkMod.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricSparkMod.java @@ -21,10 +21,8 @@ package me.lucko.spark.fabric; import com.mojang.brigadier.CommandDispatcher; - import me.lucko.spark.fabric.plugin.FabricClientSparkPlugin; import me.lucko.spark.fabric.plugin.FabricServerSparkPlugin; - import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java index b76ad9bf..4f25f2b4 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.minecraft.client.MinecraftClient; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickReporter.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickReporter.java index b71ac848..6a6addde 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickReporter.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickReporter.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.SimpleTickReporter; import me.lucko.spark.common.tick.TickReporter; - import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.minecraft.client.MinecraftClient; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricWorldInfoProvider.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricWorldInfoProvider.java index 99da1fae..926e8a36 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricWorldInfoProvider.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricWorldInfoProvider.java @@ -22,7 +22,6 @@ import it.unimi.dsi.fastutil.longs.LongIterator; import it.unimi.dsi.fastutil.longs.LongSet; - import me.lucko.spark.common.platform.world.AbstractChunkInfo; import me.lucko.spark.common.platform.world.CountMap; import me.lucko.spark.common.platform.world.WorldInfoProvider; @@ -30,7 +29,6 @@ import me.lucko.spark.fabric.mixin.ClientWorldAccessor; import me.lucko.spark.fabric.mixin.ServerEntityManagerAccessor; import me.lucko.spark.fabric.mixin.ServerWorldAccessor; - import net.minecraft.client.MinecraftClient; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientEntityManagerAccessor.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientEntityManagerAccessor.java index cc7de1f4..d2c266c7 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientEntityManagerAccessor.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientEntityManagerAccessor.java @@ -24,7 +24,6 @@ import net.minecraft.world.entity.ClientEntityManager; import net.minecraft.world.entity.EntityIndex; import net.minecraft.world.entity.SectionedEntityCache; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientWorldAccessor.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientWorldAccessor.java index ca790e94..3940101a 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientWorldAccessor.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ClientWorldAccessor.java @@ -22,7 +22,6 @@ import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; - import net.minecraft.world.entity.ClientEntityManager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientAccessor.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientAccessor.java index 7a4fb785..dfe9494d 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientAccessor.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/MinecraftClientAccessor.java @@ -21,7 +21,6 @@ package me.lucko.spark.fabric.mixin; import net.minecraft.client.MinecraftClient; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerEntityManagerAccessor.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerEntityManagerAccessor.java index 2c67502c..8acc76d7 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerEntityManagerAccessor.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerEntityManagerAccessor.java @@ -24,7 +24,6 @@ import net.minecraft.server.world.ServerEntityManager; import net.minecraft.world.entity.EntityIndex; import net.minecraft.world.entity.SectionedEntityCache; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerWorldAccessor.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerWorldAccessor.java index cf2e7e85..0254e750 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerWorldAccessor.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/mixin/ServerWorldAccessor.java @@ -23,7 +23,6 @@ import net.minecraft.entity.Entity; import net.minecraft.server.world.ServerEntityManager; import net.minecraft.server.world.ServerWorld; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/placeholder/SparkFabricPlaceholderApi.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/placeholder/SparkFabricPlaceholderApi.java index f269a199..4e627ac0 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/placeholder/SparkFabricPlaceholderApi.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/placeholder/SparkFabricPlaceholderApi.java @@ -24,16 +24,13 @@ import eu.pb4.placeholders.api.PlaceholderHandler; import eu.pb4.placeholders.api.PlaceholderResult; import eu.pb4.placeholders.api.Placeholders; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.util.SparkPlaceholder; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.text.Text; import net.minecraft.util.Identifier; - import org.jetbrains.annotations.Nullable; public enum SparkFabricPlaceholderApi { diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java index faf4eefb..0a17bd76 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java @@ -27,7 +27,6 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; - import me.lucko.spark.common.platform.MetadataProvider; import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.platform.world.WorldInfoProvider; @@ -42,7 +41,6 @@ import me.lucko.spark.fabric.FabricTickReporter; import me.lucko.spark.fabric.FabricWorldInfoProvider; import me.lucko.spark.fabric.mixin.MinecraftClientAccessor; - import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java index 1606d57e..bd937af1 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java @@ -27,7 +27,6 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; - import me.lucko.fabric.api.permissions.v0.Permissions; import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import me.lucko.spark.common.platform.MetadataProvider; @@ -47,7 +46,6 @@ import me.lucko.spark.fabric.FabricTickReporter; import me.lucko.spark.fabric.FabricWorldInfoProvider; import me.lucko.spark.fabric.placeholder.SparkFabricPlaceholderApi; - import net.fabricmc.loader.api.FabricLoader; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java index 8b7e1381..cfc8c950 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java @@ -21,7 +21,6 @@ package me.lucko.spark.fabric.plugin; import me.lucko.spark.fabric.smap.SourceDebugCache; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.objectweb.asm.tree.ClassNode; diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java index 9a03b4e6..d1262226 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java @@ -30,7 +30,6 @@ import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; import com.mojang.brigadier.tree.LiteralCommandNode; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.command.sender.CommandSender; @@ -39,11 +38,9 @@ import me.lucko.spark.common.util.SparkThreadFactory; import me.lucko.spark.fabric.FabricClassSourceLookup; import me.lucko.spark.fabric.FabricSparkMod; - import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.metadata.Person; import net.minecraft.server.command.CommandOutput; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java index 82d66ca7..1f7d90d1 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java @@ -20,9 +20,8 @@ package me.lucko.spark.forge; -import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import cpw.mods.modlauncher.TransformingClassLoader; +import me.lucko.spark.common.sampler.source.ClassSourceLookup; public class ForgeClassSourceLookup implements ClassSourceLookup { diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java index 2b147656..0e65657b 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.command.sender.AbstractCommandSender; import me.lucko.spark.forge.plugin.ForgeSparkPlugin; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.commands.CommandSource; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeExtraMetadataProvider.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeExtraMetadataProvider.java index cac2771b..2fe187ac 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeExtraMetadataProvider.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeExtraMetadataProvider.java @@ -22,9 +22,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import me.lucko.spark.common.platform.MetadataProvider; - import net.minecraft.server.packs.repository.Pack; import net.minecraft.server.packs.repository.PackRepository; import net.minecraft.server.packs.repository.PackSource; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java index 97b3a86d..ede1996a 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java @@ -21,7 +21,9 @@ package me.lucko.spark.forge; import me.lucko.spark.common.platform.PlatformInfo; - +import net.minecraftforge.fml.ModContainer; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.forgespi.language.IModInfo; import net.minecraftforge.versions.forge.ForgeVersion; import net.minecraftforge.versions.mcp.MCPVersion; @@ -42,6 +44,14 @@ public String getName() { return "Forge"; } + @Override + public String getBrand() { + return ModList.get().getModContainerById(ForgeVersion.MOD_ID) + .map(ModContainer::getModInfo) + .map(IModInfo::getDisplayName) + .orElse("Forge"); + } + @Override public String getVersion() { return ForgeVersion.getVersion(); diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlayerPingProvider.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlayerPingProvider.java index bb2cfc64..8b96b652 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlayerPingProvider.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.forge; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerConfigProvider.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerConfigProvider.java index 6feba526..c05e7d55 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerConfigProvider.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerConfigProvider.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; - import me.lucko.spark.common.platform.serverconfig.ConfigParser; import me.lucko.spark.common.platform.serverconfig.PropertiesConfigParser; import me.lucko.spark.common.platform.serverconfig.ServerConfigProvider; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickHook.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickHook.java index 36e70b05..84de9709 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickHook.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickHook.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickReporter.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickReporter.java index c33443b2..06d0f3ed 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickReporter.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeTickReporter.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.SimpleTickReporter; import me.lucko.spark.common.tick.TickReporter; - import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeWorldInfoProvider.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeWorldInfoProvider.java index 4750c089..e10a0c87 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeWorldInfoProvider.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeWorldInfoProvider.java @@ -22,11 +22,9 @@ import it.unimi.dsi.fastutil.longs.LongIterator; import it.unimi.dsi.fastutil.longs.LongSet; - import me.lucko.spark.common.platform.world.AbstractChunkInfo; import me.lucko.spark.common.platform.world.CountMap; import me.lucko.spark.common.platform.world.WorldInfoProvider; - import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.server.MinecraftServer; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java index a8c7c92e..9cfb6216 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java @@ -26,7 +26,6 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; - import me.lucko.spark.common.platform.MetadataProvider; import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.platform.world.WorldInfoProvider; @@ -40,7 +39,6 @@ import me.lucko.spark.forge.ForgeTickHook; import me.lucko.spark.forge.ForgeTickReporter; import me.lucko.spark.forge.ForgeWorldInfoProvider; - import net.minecraft.client.Minecraft; import net.minecraft.commands.CommandSource; import net.minecraft.commands.CommandSourceStack; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java index 87370579..11281f12 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java @@ -28,7 +28,6 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import me.lucko.spark.common.platform.MetadataProvider; import me.lucko.spark.common.platform.PlatformInfo; @@ -46,7 +45,6 @@ import me.lucko.spark.forge.ForgeTickHook; import me.lucko.spark.forge.ForgeTickReporter; import me.lucko.spark.forge.ForgeWorldInfoProvider; - import net.minecraft.commands.CommandSource; import net.minecraft.commands.CommandSourceStack; import net.minecraft.server.MinecraftServer; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeSparkPlugin.java index 56061b9c..258684db 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeSparkPlugin.java @@ -30,7 +30,6 @@ import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; import com.mojang.brigadier.tree.LiteralCommandNode; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.command.sender.CommandSender; @@ -39,11 +38,9 @@ import me.lucko.spark.common.util.SparkThreadFactory; import me.lucko.spark.forge.ForgeClassSourceLookup; import me.lucko.spark.forge.ForgeSparkMod; - import net.minecraft.commands.CommandSource; import net.minecraftforge.fml.ModList; import net.minecraftforge.forgespi.language.IModInfo; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgePlatformInfo.java b/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgePlatformInfo.java index 18d88c3a..6a2338f5 100644 --- a/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgePlatformInfo.java +++ b/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgePlatformInfo.java @@ -21,7 +21,10 @@ package me.lucko.spark.neoforge; import me.lucko.spark.common.platform.PlatformInfo; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.ModList; import net.neoforged.fml.loading.FMLLoader; +import net.neoforged.neoforgespi.language.IModInfo; public class NeoForgePlatformInfo implements PlatformInfo { private final Type type; @@ -40,6 +43,14 @@ public String getName() { return "NeoForge"; } + @Override + public String getBrand() { + return ModList.get().getModContainerById("neoforge") + .map(ModContainer::getModInfo) + .map(IModInfo::getDisplayName) + .orElse("NeoForge"); + } + @Override public String getVersion() { return FMLLoader.versionInfo().neoForgeVersion(); diff --git a/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgeSparkMod.java b/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgeSparkMod.java index 1a038318..72436c9d 100644 --- a/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgeSparkMod.java +++ b/spark-neoforge/src/main/java/me/lucko/spark/neoforge/NeoForgeSparkMod.java @@ -24,7 +24,6 @@ import me.lucko.spark.neoforge.plugin.NeoForgeServerSparkPlugin; import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.IExtensionPoint; import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitClassSourceLookup.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitClassSourceLookup.java index 180e0af8..e815b6cb 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitClassSourceLookup.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitClassSourceLookup.java @@ -20,9 +20,8 @@ package me.lucko.spark.nukkit; -import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import cn.nukkit.plugin.PluginClassLoader; +import me.lucko.spark.common.sampler.source.ClassSourceLookup; import java.io.IOException; import java.net.URISyntaxException; diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitCommandSender.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitCommandSender.java index 56d143fe..3d6de227 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitCommandSender.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitCommandSender.java @@ -20,14 +20,12 @@ package me.lucko.spark.nukkit; +import cn.nukkit.Player; +import cn.nukkit.command.CommandSender; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import cn.nukkit.Player; -import cn.nukkit.command.CommandSender; - import java.util.UUID; public class NukkitCommandSender extends AbstractCommandSender { diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlatformInfo.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlatformInfo.java index ab7a40bd..a1c9c5b9 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlatformInfo.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlatformInfo.java @@ -20,9 +20,8 @@ package me.lucko.spark.nukkit; -import me.lucko.spark.common.platform.PlatformInfo; - import cn.nukkit.Server; +import me.lucko.spark.common.platform.PlatformInfo; public class NukkitPlatformInfo implements PlatformInfo { private final Server server; @@ -41,6 +40,11 @@ public String getName() { return "Nukkit"; } + @Override + public String getBrand() { + return this.server.getName(); + } + @Override public String getVersion() { return this.server.getNukkitVersion(); diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlayerPingProvider.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlayerPingProvider.java index fc25d7c0..b2e5100f 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlayerPingProvider.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitPlayerPingProvider.java @@ -20,12 +20,10 @@ package me.lucko.spark.nukkit; -import com.google.common.collect.ImmutableMap; - -import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import cn.nukkit.Player; import cn.nukkit.Server; +import com.google.common.collect.ImmutableMap; +import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import java.util.Map; diff --git a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java index ae212413..39be28d3 100644 --- a/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java +++ b/spark-nukkit/src/main/java/me/lucko/spark/nukkit/NukkitSparkPlugin.java @@ -20,6 +20,10 @@ package me.lucko.spark.nukkit; +import cn.nukkit.command.Command; +import cn.nukkit.command.CommandSender; +import cn.nukkit.plugin.PluginBase; +import cn.nukkit.plugin.service.ServicePriority; import me.lucko.spark.api.Spark; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; @@ -27,11 +31,6 @@ import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.sampler.source.ClassSourceLookup; -import cn.nukkit.command.Command; -import cn.nukkit.command.CommandSender; -import cn.nukkit.plugin.PluginBase; -import cn.nukkit.plugin.service.ServicePriority; - import java.nio.file.Path; import java.util.logging.Level; import java.util.stream.Stream; diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java index 899ce58c..9342f3d8 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7ClassSourceLookup.java @@ -21,7 +21,6 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import org.spongepowered.api.Game; import java.nio.file.Path; diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java index b0cfd3cd..f19dfcef 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java @@ -21,10 +21,8 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; - import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.serializer.TextSerializers; diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java index 91d7ea2b..37463b11 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.platform.PlatformInfo; - import org.spongepowered.api.Game; import org.spongepowered.api.Platform; @@ -42,6 +41,11 @@ public String getName() { return "Sponge"; } + @Override + public String getBrand() { + return this.game.getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getName(); + } + @Override public String getVersion() { return this.game.getPlatform().getContainer(Platform.Component.IMPLEMENTATION).getVersion().orElse("unknown"); diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlayerPingProvider.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlayerPingProvider.java index 8f4c15f9..12fff783 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlayerPingProvider.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.sponge; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import org.spongepowered.api.Server; import org.spongepowered.api.entity.living.player.Player; diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java index 0e3f4ebf..7cd73f48 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java @@ -21,7 +21,6 @@ package me.lucko.spark.sponge; import com.google.inject.Inject; - import me.lucko.spark.api.Spark; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; @@ -31,7 +30,6 @@ import me.lucko.spark.common.sampler.ThreadDumper; import me.lucko.spark.common.sampler.source.ClassSourceLookup; import me.lucko.spark.common.tick.TickHook; - import org.slf4j.Logger; import org.spongepowered.api.Game; import org.spongepowered.api.command.CommandCallable; @@ -50,14 +48,13 @@ import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; +import javax.annotation.Nullable; import java.nio.file.Path; import java.util.List; import java.util.Optional; import java.util.logging.Level; import java.util.stream.Stream; -import javax.annotation.Nullable; - @Plugin( id = "spark", name = "spark", diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java index 26185222..c2b14835 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import org.spongepowered.api.scheduler.Task; public class Sponge7TickHook extends AbstractTickHook implements TickHook, Runnable { diff --git a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java index df58028c..8c2e412f 100644 --- a/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7WorldInfoProvider.java @@ -22,11 +22,9 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; - import me.lucko.spark.common.platform.world.AbstractChunkInfo; import me.lucko.spark.common.platform.world.CountMap; import me.lucko.spark.common.platform.world.WorldInfoProvider; - import org.spongepowered.api.Server; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.EntityType; diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8ClassSourceLookup.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8ClassSourceLookup.java index 7f02e755..52218e52 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8ClassSourceLookup.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8ClassSourceLookup.java @@ -21,9 +21,7 @@ package me.lucko.spark.sponge; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import org.spongepowered.api.Game; import org.spongepowered.plugin.PluginCandidate; import org.spongepowered.plugin.PluginContainer; diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8CommandSender.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8CommandSender.java index e7878dcf..8bf67bde 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8CommandSender.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8CommandSender.java @@ -21,11 +21,9 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.audience.Audience; import net.kyori.adventure.identity.Identity; import net.kyori.adventure.text.Component; - import org.spongepowered.api.command.CommandCause; import org.spongepowered.api.service.permission.Subject; import org.spongepowered.api.util.Identifiable; diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlatformInfo.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlatformInfo.java index 9589ddfb..840a6864 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlatformInfo.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlatformInfo.java @@ -21,9 +21,9 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.platform.PlatformInfo; - import org.spongepowered.api.Game; import org.spongepowered.api.Platform; +import org.spongepowered.plugin.metadata.PluginMetadata; public class Sponge8PlatformInfo implements PlatformInfo { private final Game game; @@ -42,6 +42,12 @@ public String getName() { return "Sponge"; } + @Override + public String getBrand() { + PluginMetadata brandMetadata = this.game.platform().container(Platform.Component.IMPLEMENTATION).metadata(); + return brandMetadata.name().orElseGet(brandMetadata::id); + } + @Override public String getVersion() { return this.game.platform().container(Platform.Component.IMPLEMENTATION).metadata().version().toString(); diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlayerPingProvider.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlayerPingProvider.java index 2bcaf6af..e908d0d8 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlayerPingProvider.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8PlayerPingProvider.java @@ -21,9 +21,7 @@ package me.lucko.spark.sponge; import com.google.common.collect.ImmutableMap; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import org.spongepowered.api.Server; import org.spongepowered.api.entity.living.player.server.ServerPlayer; 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 5faf843f..8e875ec3 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 @@ -22,7 +22,6 @@ import com.google.common.base.Suppliers; import com.google.inject.Inject; - import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.command.sender.CommandSender; @@ -33,9 +32,7 @@ import me.lucko.spark.common.sampler.source.ClassSourceLookup; import me.lucko.spark.common.sampler.source.SourceMetadata; import me.lucko.spark.common.tick.TickHook; - import net.kyori.adventure.text.Component; - import org.apache.logging.log4j.Logger; import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.Game; diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8TickHook.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8TickHook.java index 6db51b8b..6502da28 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8TickHook.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8TickHook.java @@ -22,7 +22,6 @@ import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; - import org.spongepowered.api.Game; import org.spongepowered.api.scheduler.ScheduledTask; import org.spongepowered.api.scheduler.Task; diff --git a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8WorldInfoProvider.java b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8WorldInfoProvider.java index 69b4515d..fadd629a 100644 --- a/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8WorldInfoProvider.java +++ b/spark-sponge8/src/main/java/me/lucko/spark/sponge/Sponge8WorldInfoProvider.java @@ -22,11 +22,9 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; - import me.lucko.spark.common.platform.world.AbstractChunkInfo; import me.lucko.spark.common.platform.world.CountMap; import me.lucko.spark.common.platform.world.WorldInfoProvider; - import org.spongepowered.api.Server; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.EntityType; 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 9b697c32..eba00a05 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 @@ -22,9 +22,7 @@ import com.velocitypowered.api.plugin.PluginContainer; import com.velocitypowered.api.plugin.PluginManager; - import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashMap; diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityCommandSender.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityCommandSender.java index ce372a64..62f7f758 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityCommandSender.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityCommandSender.java @@ -23,9 +23,7 @@ import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.proxy.ConsoleCommandSource; import com.velocitypowered.api.proxy.Player; - import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.text.Component; import java.util.UUID; diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlatformInfo.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlatformInfo.java index 4ee42cb1..eba1567f 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlatformInfo.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.velocity; import com.velocitypowered.api.proxy.ProxyServer; - import me.lucko.spark.common.platform.PlatformInfo; public class VelocityPlatformInfo implements PlatformInfo { @@ -41,6 +40,11 @@ public String getName() { return "Velocity"; } + @Override + public String getBrand() { + return this.proxy.getVersion().getName(); + } + @Override public String getVersion() { return this.proxy.getVersion().getVersion(); diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlayerPingProvider.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlayerPingProvider.java index 382ea220..6cd4445e 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlayerPingProvider.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocityPlayerPingProvider.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ProxyServer; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import java.util.Map; 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 4a89a4e8..da7bd188 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 @@ -29,14 +29,12 @@ import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.ProxyServer; - 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 org.slf4j.Logger; import java.nio.file.Path; 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 84840d2e..c01e8a15 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 @@ -22,9 +22,7 @@ import com.velocitypowered.api.plugin.PluginContainer; import com.velocitypowered.api.plugin.PluginManager; - import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashMap; diff --git a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4CommandSender.java b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4CommandSender.java index d346c2ce..11549eeb 100644 --- a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4CommandSender.java +++ b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4CommandSender.java @@ -23,9 +23,7 @@ import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.command.ConsoleCommandSource; import com.velocitypowered.api.proxy.connection.Player; - import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.text.Component; import java.util.UUID; diff --git a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlatformInfo.java b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlatformInfo.java index bb2f26b6..86f5b951 100644 --- a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlatformInfo.java +++ b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlatformInfo.java @@ -21,7 +21,6 @@ package me.lucko.spark.velocity; import com.velocitypowered.api.proxy.ProxyServer; - import me.lucko.spark.common.platform.PlatformInfo; public class Velocity4PlatformInfo implements PlatformInfo { @@ -41,6 +40,11 @@ public String getName() { return "Velocity"; } + @Override + public String getBrand() { + return this.proxy.version().name(); + } + @Override public String getVersion() { return this.proxy.version().version(); diff --git a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlayerPingProvider.java b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlayerPingProvider.java index 18f36a7c..32114e51 100644 --- a/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlayerPingProvider.java +++ b/spark-velocity4/src/main/java/me/lucko/spark/velocity/Velocity4PlayerPingProvider.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.connection.Player; - import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import java.util.Map; 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 b6382468..0a0346e8 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 @@ -29,14 +29,12 @@ import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.ProxyServer; - 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 org.slf4j.Logger; import java.nio.file.Path; diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java index 2207c9ee..8a34983b 100644 --- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java +++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java @@ -20,11 +20,10 @@ package me.lucko.spark.waterdog; -import me.lucko.spark.common.sampler.source.ClassSourceLookup; - import dev.waterdog.waterdogpe.ProxyServer; import dev.waterdog.waterdogpe.plugin.Plugin; import dev.waterdog.waterdogpe.plugin.PluginClassLoader; +import me.lucko.spark.common.sampler.source.ClassSourceLookup; import java.util.Map; import java.util.WeakHashMap; diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogCommandSender.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogCommandSender.java index 8d7223a3..259e8328 100644 --- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogCommandSender.java +++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogCommandSender.java @@ -20,14 +20,12 @@ package me.lucko.spark.waterdog; +import dev.waterdog.waterdogpe.command.CommandSender; +import dev.waterdog.waterdogpe.player.ProxiedPlayer; import me.lucko.spark.common.command.sender.AbstractCommandSender; - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import dev.waterdog.waterdogpe.command.CommandSender; -import dev.waterdog.waterdogpe.player.ProxiedPlayer; - import java.util.UUID; public class WaterdogCommandSender extends AbstractCommandSender { diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlatformInfo.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlatformInfo.java index 14b8f607..b32d427b 100644 --- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlatformInfo.java +++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlatformInfo.java @@ -20,9 +20,8 @@ package me.lucko.spark.waterdog; -import me.lucko.spark.common.platform.PlatformInfo; - import dev.waterdog.waterdogpe.WaterdogPE; +import me.lucko.spark.common.platform.PlatformInfo; public class WaterdogPlatformInfo implements PlatformInfo { @@ -36,6 +35,11 @@ public String getName() { return "Waterdog"; } + @Override + public String getBrand() { + return "Waterdog"; + } + @Override public String getVersion() { return WaterdogPE.version().baseVersion(); diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlayerPingProvider.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlayerPingProvider.java index b22325c9..03c9242a 100644 --- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlayerPingProvider.java +++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogPlayerPingProvider.java @@ -21,11 +21,9 @@ package me.lucko.spark.waterdog; import com.google.common.collect.ImmutableMap; - -import me.lucko.spark.common.monitor.ping.PlayerPingProvider; - import dev.waterdog.waterdogpe.ProxyServer; import dev.waterdog.waterdogpe.player.ProxiedPlayer; +import me.lucko.spark.common.monitor.ping.PlayerPingProvider; import java.util.Map; diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java index 23aa6a68..d7ef0888 100644 --- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java +++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java @@ -20,6 +20,10 @@ package me.lucko.spark.waterdog; +import dev.waterdog.waterdogpe.ProxyServer; +import dev.waterdog.waterdogpe.command.Command; +import dev.waterdog.waterdogpe.command.CommandSender; +import dev.waterdog.waterdogpe.plugin.Plugin; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.monitor.ping.PlayerPingProvider; @@ -27,11 +31,6 @@ import me.lucko.spark.common.sampler.source.ClassSourceLookup; import me.lucko.spark.common.sampler.source.SourceMetadata; -import dev.waterdog.waterdogpe.ProxyServer; -import dev.waterdog.waterdogpe.command.Command; -import dev.waterdog.waterdogpe.command.CommandSender; -import dev.waterdog.waterdogpe.plugin.Plugin; - import java.nio.file.Path; import java.util.Collection; import java.util.logging.Level;