File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
src/main/java/org/mvplugins/multiverse/inventories Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ package org .mvplugins .multiverse .inventories ;
2+
3+ import org .jvnet .hk2 .annotations .Service ;
4+ import org .mvplugins .multiverse .external .bstats .bukkit .Metrics ;
5+ import org .mvplugins .multiverse .external .jakarta .inject .Inject ;
6+
7+ @ Service
8+ final class BstatsMetricsConfigurator {
9+
10+ private static final int PLUGIN_ID = 7768 ;
11+ private final Metrics metrics ;
12+
13+ @ Inject
14+ private BstatsMetricsConfigurator (MultiverseInventories plugin ) {
15+ this .metrics = new Metrics (plugin , PLUGIN_ID );
16+ }
17+ }
Original file line number Diff line number Diff line change 22
33import com .dumptruckman .minecraft .util .Logging ;
44import org .bukkit .entity .Player ;
5- import org .bukkit .plugin .PluginManager ;
65import org .mvplugins .multiverse .core .config .CoreConfig ;
76import org .mvplugins .multiverse .core .destination .DestinationsProvider ;
87import org .mvplugins .multiverse .core .module .MultiverseModule ;
@@ -73,6 +72,8 @@ public class MultiverseInventories extends MultiverseModule {
7372 private Provider <MVInvCommandConditions > mvInvCommandConditions ;
7473 @ Inject
7574 private Provider <MVInvCommandPermissions > mvInvCommandPermissions ;
75+ @ Inject
76+ private Provider <BstatsMetricsConfigurator > metricsConfiguratorProvider ;
7677
7778 private InventoriesDupingPatch dupingPatch ;
7879
@@ -110,6 +111,7 @@ public final void onEnable() {
110111 this .setUpLocales ();
111112 this .registerCommands ();
112113 this .registerDestinations ();
114+ this .setupMetrics ();
113115
114116 // Hook plugins that can be imported from
115117 this .hookImportables ();
@@ -183,6 +185,17 @@ private void hookLuckPerms() {
183185 });
184186 }
185187
188+ /**
189+ * Setup bstats Metrics.
190+ */
191+ private void setupMetrics () {
192+ Try .of (() -> metricsConfiguratorProvider .get ())
193+ .onFailure (e -> {
194+ Logging .severe ("Failed to setup metrics" );
195+ e .printStackTrace ();
196+ });
197+ }
198+
186199 /**
187200 * {@inheritDoc}
188201 */
You can’t perform that action at this time.
0 commit comments