Update SpongeAPI version to 7.2.0

This commit is contained in:
Blue (Lukas Rieger) 2020-07-30 17:05:17 +02:00
parent 7dbff21f40
commit 68f3205792
2 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,5 @@
dependencies { 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 group: 'org.bstats', name: 'bstats-sponge-lite', version: '1.5'
compile (project(':BlueMapCommon')) { compile (project(':BlueMapCommon')) {

View File

@ -39,7 +39,9 @@
import org.spongepowered.api.event.game.GameReloadEvent; import org.spongepowered.api.event.game.GameReloadEvent;
import org.spongepowered.api.event.game.state.GameStartingServerEvent; import org.spongepowered.api.event.game.state.GameStartingServerEvent;
import org.spongepowered.api.event.game.state.GameStoppingEvent; import org.spongepowered.api.event.game.state.GameStoppingEvent;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.scheduler.SpongeExecutorService; import org.spongepowered.api.scheduler.SpongeExecutorService;
import org.spongepowered.api.util.Tristate;
import org.spongepowered.api.world.World; import org.spongepowered.api.world.World;
import org.spongepowered.api.world.storage.WorldProperties; import org.spongepowered.api.world.storage.WorldProperties;
@ -161,4 +163,17 @@ public File getConfigFolder() {
return configurationDir.toFile(); 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();
}
} }