From bb0dda0bc91035e95ce7cc6fca932a6c210f75d5 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sun, 16 May 2021 22:03:51 +0200 Subject: [PATCH] Update bstats to version 2.2.1 --- implementations/spigot/build.gradle | 4 ++-- .../bluecolored/bluemap/bukkit/BukkitPlugin.java | 16 ++++++++-------- implementations/sponge-7.2.0/build.gradle | 2 +- .../bluecolored/bluemap/sponge/SpongePlugin.java | 11 +++++------ implementations/sponge-8.0.0/build.gradle | 4 ++-- .../bluemap/sponge8/SpongePlugin.java | 11 +++++------ 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/implementations/spigot/build.gradle b/implementations/spigot/build.gradle index 3a2fc106..61caed4e 100644 --- a/implementations/spigot/build.gradle +++ b/implementations/spigot/build.gradle @@ -11,7 +11,7 @@ repositories { dependencies { shadow "org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT" - implementation group: 'org.bstats', name: 'bstats-bukkit-lite', version: '1.5' + implementation group: 'org.bstats', name: 'bstats-bukkit', version: '2.2.1' implementation (project(':BlueMapCommon')) { //exclude dependencies provided by bukkit @@ -30,7 +30,7 @@ build.dependsOn shadowJar { relocate 'org.spongepowered.configurate', 'de.bluecolored.shadow.configurate' relocate 'org.apache.commons.io', 'de.bluecolored.shadow.apache.commons.io' relocate 'org.apache.commons.lang3', 'de.bluecolored.shadow.apache.commons.lang3' - relocate 'org.bstats.bukkit', 'de.bluecolored.shadow.bstats.bukkit' + relocate 'org.bstats', 'de.bluecolored.shadow.bstats' relocate 'com.mojang.brigadier', 'de.bluecolored.shadow.mojang.brigadier' relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine' relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone' diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java index 452f37ae..90a10cd4 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java @@ -31,7 +31,7 @@ import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; import de.bluecolored.bluemap.core.resourcepack.ParseResourceException; -import org.bstats.bukkit.MetricsLite; +import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.command.CommandMap; @@ -58,13 +58,13 @@ public class BukkitPlugin extends JavaPlugin implements ServerInterface, Listene private static BukkitPlugin instance; - private Plugin pluginInstance; - private EventForwarder eventForwarder; - private BukkitCommands commands; + private final Plugin pluginInstance; + private final EventForwarder eventForwarder; + private final BukkitCommands commands; private int playerUpdateIndex = 0; - private Map onlinePlayerMap; - private List onlinePlayerList; + private final Map onlinePlayerMap; + private final List onlinePlayerList; public BukkitPlugin() { Logger.global = new JavaLogger(getLogger()); @@ -145,8 +145,8 @@ public void onEnable() { } }); - //init bstats - new MetricsLite(this); + //bstats + new Metrics(this, 5912); } @Override diff --git a/implementations/sponge-7.2.0/build.gradle b/implementations/sponge-7.2.0/build.gradle index 41034480..698ee074 100644 --- a/implementations/sponge-7.2.0/build.gradle +++ b/implementations/sponge-7.2.0/build.gradle @@ -1,7 +1,7 @@ dependencies { shadow "org.spongepowered:spongeapi:7.2.0" - implementation group: 'org.bstats', name: 'bstats-sponge-lite', version: '1.5' + implementation group: 'org.bstats', name: 'bstats-sponge', version: '2.2.1' implementation (project(':BlueMapCommon')) { //exclude dependencies provided by sponge diff --git a/implementations/sponge-7.2.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java b/implementations/sponge-7.2.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java index 1f93a334..985a010c 100644 --- a/implementations/sponge-7.2.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java +++ b/implementations/sponge-7.2.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java @@ -34,7 +34,7 @@ import de.bluecolored.bluemap.sponge.SpongeCommands.SpongeCommandProxy; import net.querz.nbt.CompoundTag; import net.querz.nbt.NBTUtil; -import org.bstats.sponge.MetricsLite2; +import org.bstats.sponge.Metrics; import org.spongepowered.api.Sponge; import org.spongepowered.api.config.ConfigDir; import org.spongepowered.api.event.Listener; @@ -69,10 +69,6 @@ public class SpongePlugin implements ServerInterface { @ConfigDir(sharedRoot = false) private Path configurationDir; - @Inject - @SuppressWarnings("unused") - private MetricsLite2 metrics; - private final Plugin pluginInstance; private final SpongeCommands commands; @@ -84,7 +80,7 @@ public class SpongePlugin implements ServerInterface { private final List onlinePlayerList; @Inject - public SpongePlugin(org.slf4j.Logger logger) { + public SpongePlugin(org.slf4j.Logger logger, Metrics.Factory metricsFactory) { Logger.global = new Slf4jLogger(logger); this.onlinePlayerMap = new ConcurrentHashMap<>(); @@ -99,6 +95,9 @@ public SpongePlugin(org.slf4j.Logger logger) { this.pluginInstance = new Plugin(version, "sponge", this); this.commands = new SpongeCommands(pluginInstance); + + //bstats + metricsFactory.make(5911); } @Listener diff --git a/implementations/sponge-8.0.0/build.gradle b/implementations/sponge-8.0.0/build.gradle index dfba4b05..152f4166 100644 --- a/implementations/sponge-8.0.0/build.gradle +++ b/implementations/sponge-8.0.0/build.gradle @@ -1,7 +1,7 @@ dependencies { shadow "org.spongepowered:spongeapi:8.0.0-SNAPSHOT" - implementation group: 'org.bstats', name: 'bstats-sponge-lite', version: '1.5' + implementation group: 'org.bstats', name: 'bstats-sponge', version: '2.2.1' implementation (project(':BlueMapCommon')) { //exclude dependencies provided by sponge @@ -23,7 +23,7 @@ build.dependsOn shadowJar { relocate 'com.mojang.brigadier', 'de.bluecolored.shadow.mojang.brigadier' relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine' relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone' - relocate 'ninja.leaping.configurate', 'de.bluecolored.shadow.ninja.leaping.configurate' + relocate 'org.spongepowered.configurate', 'de.bluecolored.shadow.configurate' relocate 'org.aopalliance', 'de.bluecolored.shadow.aopalliance' relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config' relocate 'org.checkerframework', 'de.bluecolored.shadow.checkerframework' diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge8/SpongePlugin.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge8/SpongePlugin.java index 6f8dcb2b..794db36f 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge8/SpongePlugin.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge8/SpongePlugin.java @@ -38,6 +38,7 @@ import de.bluecolored.bluemap.sponge8.SpongeCommands.SpongeCommandProxy; import net.querz.nbt.CompoundTag; import net.querz.nbt.NBTUtil; +import org.bstats.sponge.Metrics; import org.spongepowered.api.Platform; import org.spongepowered.api.Server; import org.spongepowered.api.Sponge; @@ -73,11 +74,6 @@ public class SpongePlugin implements ServerInterface { @Inject @ConfigDir(sharedRoot = false) private Path configurationDir; - -// TODO Bstats needs updating -// @Inject -// @SuppressWarnings("unused") -// private MetricsLite2 metrics; private final Plugin pluginInstance; private final SpongeCommands commands; @@ -90,7 +86,7 @@ public class SpongePlugin implements ServerInterface { private final List onlinePlayerList; @Inject - public SpongePlugin(org.apache.logging.log4j.Logger logger, PluginContainer pluginContainer) { + public SpongePlugin(org.apache.logging.log4j.Logger logger, PluginContainer pluginContainer, Metrics.Factory metricsFactory) { Logger.global = new Log4J2Logger(logger); this.pluginContainer = pluginContainer; @@ -107,6 +103,9 @@ public SpongePlugin(org.apache.logging.log4j.Logger logger, PluginContainer plug this.pluginInstance = new Plugin(version, "sponge", this); this.commands = new SpongeCommands(pluginInstance); + + //bstats + metricsFactory.make(5911); } @Listener