diff --git a/BlueMapBukkit/src/main/resources/plugin.yml b/BlueMapBukkit/src/main/resources/plugin.yml index 88cae5be..0db125e0 100644 --- a/BlueMapBukkit/src/main/resources/plugin.yml +++ b/BlueMapBukkit/src/main/resources/plugin.yml @@ -2,6 +2,7 @@ name: BlueMap description: "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)" main: de.bluecolored.bluemap.bukkit.BukkitPlugin version: ${version} +api-version: 1.13 author: "Blue (TBlueF / Lukas Rieger)" website: "https://github.com/BlueMap-Minecraft" commands: diff --git a/BlueMapSponge/build.gradle b/BlueMapSponge/build.gradle index 5e5de5aa..b5481d12 100644 --- a/BlueMapSponge/build.gradle +++ b/BlueMapSponge/build.gradle @@ -1,5 +1,5 @@ dependencies { - shadow "org.spongepowered:spongeapi:7.1.0-SNAPSHOT" + shadow "org.spongepowered:spongeapi:7.2.0" compile group: 'org.bstats', name: 'bstats-sponge-lite', version: '1.5' compile (project(':BlueMapCommon')) { diff --git a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java index a6fc6ee3..1cb01c3b 100644 --- a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java +++ b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java @@ -39,7 +39,9 @@ import org.spongepowered.api.event.game.GameReloadEvent; import org.spongepowered.api.event.game.state.GameStartingServerEvent; import org.spongepowered.api.event.game.state.GameStoppingEvent; +import org.spongepowered.api.plugin.PluginContainer; import org.spongepowered.api.scheduler.SpongeExecutorService; +import org.spongepowered.api.util.Tristate; import org.spongepowered.api.world.World; import org.spongepowered.api.world.storage.WorldProperties; @@ -161,4 +163,17 @@ public File getConfigFolder() { return configurationDir.toFile(); } + @Override + public boolean isMetricsEnabled(boolean configValue) { + PluginContainer pluginContainer = Sponge.getPluginManager().fromInstance(this).orElse(null); + if (pluginContainer != null) { + Tristate metricsEnabled = Sponge.getMetricsConfigManager().getCollectionState(pluginContainer); + if (metricsEnabled != Tristate.UNDEFINED) { + return metricsEnabled == Tristate.TRUE ? true : false; + } + } + + return Sponge.getMetricsConfigManager().getGlobalCollectionState().asBoolean(); + } + }