File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/main/java/com/jaimemartz/playerbalancer Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,13 @@ public void onEnable() {
4949 factory .submit (ConfigEntries .class );
5050 }
5151
52- this .enable ();
53-
54- //Metrics (https://bstats.org/)
5552 Metrics metrics = new Metrics (this );
56- metrics .addCustomChart (new SingleLineChart ("configured_sections" , () -> sectionManager .getSections ().size ()));
53+ if (this .enable ()) {
54+ metrics .addCustomChart (new SingleLineChart ("configured_sections" , () -> sectionManager .getSections ().size ()));
55+ }
5756 }
5857
59- private void enable () {
58+ private boolean enable () {
6059 factory .load (0 , true );
6160
6261 mainCommand = new MainCommand (this );
@@ -121,6 +120,7 @@ private void enable() {
121120 }
122121
123122 getLogger ().info ("The plugin has finished loading without any problems" );
123+ return true ;
124124 } catch (RuntimeException e ) {
125125 this .failed = true ;
126126 getLogger ().severe ("The plugin could not continue loading due to an unexpected exception" );
@@ -132,6 +132,7 @@ private void enable() {
132132 getLogger ().warning ("Nothing is going to work until you do that, you can reload me by using the /balancer command" );
133133 getLogger ().warning ("-----------------------------------------------------" );
134134 }
135+ return false ;
135136 }
136137
137138 @ Override
You can’t perform that action at this time.
0 commit comments