Update bstats to version 2.2.1

This commit is contained in:
Blue (Lukas Rieger) 2021-05-16 22:03:51 +02:00
parent 445b18cd65
commit bb0dda0bc9
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
6 changed files with 23 additions and 25 deletions

View File

@ -11,7 +11,7 @@ repositories {
dependencies { dependencies {
shadow "org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT" 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')) { implementation (project(':BlueMapCommon')) {
//exclude dependencies provided by bukkit //exclude dependencies provided by bukkit
@ -30,7 +30,7 @@ build.dependsOn shadowJar {
relocate 'org.spongepowered.configurate', 'de.bluecolored.shadow.configurate' relocate 'org.spongepowered.configurate', 'de.bluecolored.shadow.configurate'
relocate 'org.apache.commons.io', 'de.bluecolored.shadow.apache.commons.io' relocate 'org.apache.commons.io', 'de.bluecolored.shadow.apache.commons.io'
relocate 'org.apache.commons.lang3', 'de.bluecolored.shadow.apache.commons.lang3' 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.mojang.brigadier', 'de.bluecolored.shadow.mojang.brigadier'
relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine' relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine'
relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone' relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone'

View File

@ -31,7 +31,7 @@
import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.MinecraftVersion;
import de.bluecolored.bluemap.core.logger.Logger; import de.bluecolored.bluemap.core.logger.Logger;
import de.bluecolored.bluemap.core.resourcepack.ParseResourceException; import de.bluecolored.bluemap.core.resourcepack.ParseResourceException;
import org.bstats.bukkit.MetricsLite; import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.CommandMap; import org.bukkit.command.CommandMap;
@ -58,13 +58,13 @@ public class BukkitPlugin extends JavaPlugin implements ServerInterface, Listene
private static BukkitPlugin instance; private static BukkitPlugin instance;
private Plugin pluginInstance; private final Plugin pluginInstance;
private EventForwarder eventForwarder; private final EventForwarder eventForwarder;
private BukkitCommands commands; private final BukkitCommands commands;
private int playerUpdateIndex = 0; private int playerUpdateIndex = 0;
private Map<UUID, Player> onlinePlayerMap; private final Map<UUID, Player> onlinePlayerMap;
private List<BukkitPlayer> onlinePlayerList; private final List<BukkitPlayer> onlinePlayerList;
public BukkitPlugin() { public BukkitPlugin() {
Logger.global = new JavaLogger(getLogger()); Logger.global = new JavaLogger(getLogger());
@ -145,8 +145,8 @@ public void onEnable() {
} }
}); });
//init bstats //bstats
new MetricsLite(this); new Metrics(this, 5912);
} }
@Override @Override

View File

@ -1,7 +1,7 @@
dependencies { dependencies {
shadow "org.spongepowered:spongeapi:7.2.0" 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')) { implementation (project(':BlueMapCommon')) {
//exclude dependencies provided by sponge //exclude dependencies provided by sponge

View File

@ -34,7 +34,7 @@
import de.bluecolored.bluemap.sponge.SpongeCommands.SpongeCommandProxy; import de.bluecolored.bluemap.sponge.SpongeCommands.SpongeCommandProxy;
import net.querz.nbt.CompoundTag; import net.querz.nbt.CompoundTag;
import net.querz.nbt.NBTUtil; import net.querz.nbt.NBTUtil;
import org.bstats.sponge.MetricsLite2; import org.bstats.sponge.Metrics;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.config.ConfigDir; import org.spongepowered.api.config.ConfigDir;
import org.spongepowered.api.event.Listener; import org.spongepowered.api.event.Listener;
@ -69,10 +69,6 @@ public class SpongePlugin implements ServerInterface {
@ConfigDir(sharedRoot = false) @ConfigDir(sharedRoot = false)
private Path configurationDir; private Path configurationDir;
@Inject
@SuppressWarnings("unused")
private MetricsLite2 metrics;
private final Plugin pluginInstance; private final Plugin pluginInstance;
private final SpongeCommands commands; private final SpongeCommands commands;
@ -84,7 +80,7 @@ public class SpongePlugin implements ServerInterface {
private final List<SpongePlayer> onlinePlayerList; private final List<SpongePlayer> onlinePlayerList;
@Inject @Inject
public SpongePlugin(org.slf4j.Logger logger) { public SpongePlugin(org.slf4j.Logger logger, Metrics.Factory metricsFactory) {
Logger.global = new Slf4jLogger(logger); Logger.global = new Slf4jLogger(logger);
this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerMap = new ConcurrentHashMap<>();
@ -99,6 +95,9 @@ public SpongePlugin(org.slf4j.Logger logger) {
this.pluginInstance = new Plugin(version, "sponge", this); this.pluginInstance = new Plugin(version, "sponge", this);
this.commands = new SpongeCommands(pluginInstance); this.commands = new SpongeCommands(pluginInstance);
//bstats
metricsFactory.make(5911);
} }
@Listener @Listener

View File

@ -1,7 +1,7 @@
dependencies { dependencies {
shadow "org.spongepowered:spongeapi:8.0.0-SNAPSHOT" 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')) { implementation (project(':BlueMapCommon')) {
//exclude dependencies provided by sponge //exclude dependencies provided by sponge
@ -23,7 +23,7 @@ build.dependsOn shadowJar {
relocate 'com.mojang.brigadier', 'de.bluecolored.shadow.mojang.brigadier' relocate 'com.mojang.brigadier', 'de.bluecolored.shadow.mojang.brigadier'
relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine' relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine'
relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone' 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 'org.aopalliance', 'de.bluecolored.shadow.aopalliance'
relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config' relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config'
relocate 'org.checkerframework', 'de.bluecolored.shadow.checkerframework' relocate 'org.checkerframework', 'de.bluecolored.shadow.checkerframework'

View File

@ -38,6 +38,7 @@
import de.bluecolored.bluemap.sponge8.SpongeCommands.SpongeCommandProxy; import de.bluecolored.bluemap.sponge8.SpongeCommands.SpongeCommandProxy;
import net.querz.nbt.CompoundTag; import net.querz.nbt.CompoundTag;
import net.querz.nbt.NBTUtil; import net.querz.nbt.NBTUtil;
import org.bstats.sponge.Metrics;
import org.spongepowered.api.Platform; import org.spongepowered.api.Platform;
import org.spongepowered.api.Server; import org.spongepowered.api.Server;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
@ -74,11 +75,6 @@ public class SpongePlugin implements ServerInterface {
@ConfigDir(sharedRoot = false) @ConfigDir(sharedRoot = false)
private Path configurationDir; private Path configurationDir;
// TODO Bstats needs updating
// @Inject
// @SuppressWarnings("unused")
// private MetricsLite2 metrics;
private final Plugin pluginInstance; private final Plugin pluginInstance;
private final SpongeCommands commands; private final SpongeCommands commands;
@ -90,7 +86,7 @@ public class SpongePlugin implements ServerInterface {
private final List<SpongePlayer> onlinePlayerList; private final List<SpongePlayer> onlinePlayerList;
@Inject @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); Logger.global = new Log4J2Logger(logger);
this.pluginContainer = pluginContainer; 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.pluginInstance = new Plugin(version, "sponge", this);
this.commands = new SpongeCommands(pluginInstance); this.commands = new SpongeCommands(pluginInstance);
//bstats
metricsFactory.make(5911);
} }
@Listener @Listener