Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.mvplugins.multiverse.inventories;

import org.jvnet.hk2.annotations.Service;
import org.mvplugins.multiverse.external.bstats.bukkit.Metrics;
import org.mvplugins.multiverse.external.jakarta.inject.Inject;

@Service
final class BstatsMetricsConfigurator {

private static final int PLUGIN_ID = 7768;
private final Metrics metrics;

@Inject
private BstatsMetricsConfigurator(MultiverseInventories plugin) {
this.metrics = new Metrics(plugin, PLUGIN_ID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.dumptruckman.minecraft.util.Logging;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.mvplugins.multiverse.core.config.CoreConfig;
import org.mvplugins.multiverse.core.destination.DestinationsProvider;
import org.mvplugins.multiverse.core.module.MultiverseModule;
Expand Down Expand Up @@ -73,6 +72,8 @@ public class MultiverseInventories extends MultiverseModule {
private Provider<MVInvCommandConditions> mvInvCommandConditions;
@Inject
private Provider<MVInvCommandPermissions> mvInvCommandPermissions;
@Inject
private Provider<BstatsMetricsConfigurator> metricsConfiguratorProvider;

private InventoriesDupingPatch dupingPatch;

Expand Down Expand Up @@ -110,6 +111,7 @@ public final void onEnable() {
this.setUpLocales();
this.registerCommands();
this.registerDestinations();
this.setupMetrics();

// Hook plugins that can be imported from
this.hookImportables();
Expand Down Expand Up @@ -183,6 +185,17 @@ private void hookLuckPerms() {
});
}

/**
* Setup bstats Metrics.
*/
private void setupMetrics() {
Try.of(() -> metricsConfiguratorProvider.get())
.onFailure(e -> {
Logging.severe("Failed to setup metrics");
e.printStackTrace();
});
}

/**
* {@inheritDoc}
*/
Expand Down
Loading