mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Manually initialize metrics.
This commit is contained in:
parent
372569ed6c
commit
472742dde8
@ -30,6 +30,7 @@ import com.onarandombox.MultiverseCore.placeholders.MultiverseCorePlaceholders;
|
||||
import com.onarandombox.MultiverseCore.utils.TestingMode;
|
||||
import com.onarandombox.MultiverseCore.utils.metrics.MetricsConfigurator;
|
||||
import com.onarandombox.MultiverseCore.world.WorldProperties;
|
||||
import io.vavr.control.Try;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.inject.Provider;
|
||||
import me.main__.util.SerializationConfig.SerializationConfig;
|
||||
@ -205,7 +206,9 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
private void setupMetrics() {
|
||||
if (TestingMode.isDisabled()) {
|
||||
// Load metrics
|
||||
serviceLocator.getService(MetricsConfigurator.class);
|
||||
serviceLocator.createAndInitialize(MetricsConfigurator.class);
|
||||
} else {
|
||||
Logging.info("Metrics are disabled in testing mode.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,13 +8,12 @@ import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorld;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.inject.Inject;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.World;
|
||||
import org.jvnet.hk2.annotations.Service;
|
||||
|
||||
@Service
|
||||
public class MetricsConfigurator {
|
||||
|
||||
private static final int PLUGIN_ID = 7765;
|
||||
@ -37,6 +36,7 @@ public class MetricsConfigurator {
|
||||
return getWorldManager().getMVWorlds();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void initMetrics() {
|
||||
try {
|
||||
addCustomGeneratorsMetric();
|
||||
|
Loading…
Reference in New Issue
Block a user