File tree Expand file tree Collapse file tree
src/main/java/me/hsgamer/bettergui Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import org .bukkit .plugin .java .JavaPlugin ;
2626
2727import java .util .Arrays ;
28+ import java .util .HashMap ;
2829import java .util .List ;
30+ import java .util .Map ;
2931
3032/**
3133 * The main class of the plugin
@@ -94,7 +96,11 @@ public void postEnable() {
9496 get (AddonManager .class ).call (PostEnable .class , PostEnable ::postEnable );
9597
9698 Metrics metrics = new Metrics (this , 6609 );
97- metrics .addCustomChart (new AdvancedPie ("addon_count" , get (AddonManager .class )::getExpansionCount ));
99+ metrics .addCustomChart (new AdvancedPie ("addon_count" , () -> {
100+ Map <String , Integer > map = new HashMap <>();
101+ get (AddonManager .class ).getEnabledExpansions ().keySet ().forEach (s -> map .put (s , 1 ));
102+ return map ;
103+ }));
98104
99105 if (getDescription ().getVersion ().contains ("SNAPSHOT" )) {
100106 getLogger ().warning ("You are using the development version" );
Original file line number Diff line number Diff line change @@ -92,17 +92,6 @@ private void checkPluginDepends(@NotNull ExpansionClassLoader loader) {
9292 }
9393 }
9494
95- /**
96- * Get expansion count
97- *
98- * @return the expansion count
99- */
100- public Map <String , Integer > getExpansionCount () {
101- Map <String , Integer > map = new HashMap <>();
102- getEnabledExpansions ().keySet ().forEach (s -> map .put (s , 1 ));
103- return map ;
104- }
105-
10695 /**
10796 * Get the plugin
10897 *
You can’t perform that action at this time.
0 commit comments