@@ -41,20 +41,24 @@ public void onLoad() {
4141 long current = System .currentTimeMillis ();
4242 this .emergencyStop = false ;
4343 new xyz .theprogramsrc .Base ();
44- this .log ("Loading plugin &3v" +this .getPluginVersion ());
4544 this .disableHooks = new ArrayList <>();
4645 this .serverFolder = Utils .folder (new File ("." ));
4746 this .firstStart = !this .getDataFolder ().exists ();
4847 Utils .folder (this .getDataFolder ());
4948 this .onPluginLoad ();
50- if (this .emergencyStop ) return ;
49+ if (this .emergencyStop ) {
50+ setEnabled (false );
51+ return ;
52+ }
5153 this .log ("Loaded plugin in " + (System .currentTimeMillis () - current ) + "ms" );
5254 }
5355
5456 @ Override
5557 public void onEnable () {
56- if (this .emergencyStop ) return ;
57- this .log ("Enabling plugin &3v" + this .getPluginVersion ());
58+ if (this .emergencyStop ) {
59+ setEnabled (false );
60+ return ;
61+ }
5862 this .settingsStorage = new SettingsStorage (this );
5963 this .translationsFolder = Utils .folder (new File (this .getDataFolder (), "translations/" ));
6064 this .translationManager = new TranslationManager (this );
@@ -66,6 +70,10 @@ public void onEnable() {
6670 this .dependencyManager = new DependencyManager (this , pluginClassLoader );
6771 this .dependencyManager .loadDependencies (Dependencies .get ());
6872 this .onPluginEnable ();
73+ if (this .emergencyStop ) {
74+ setEnabled (false );
75+ return ;
76+ }
6977 this .log ("Enabled plugin" );
7078 if (this .isFirstStart ()){
7179 if (this .isPaid ()){
@@ -80,8 +88,9 @@ public void onEnable() {
8088
8189 @ Override
8290 public void onDisable () {
83- if (this .emergencyStop ) return ;
84- this .log ("Disabling plugin &3v" + this .getPluginVersion ());
91+ if (this .emergencyStop ) {
92+ return ;
93+ }
8594 this .getDisableHooks ().forEach (Runnable ::run );
8695 this .onPluginDisable ();
8796 this .log ("Disabled plugin" );
@@ -225,4 +234,8 @@ public void emergencyStop() {
225234 this .emergencyStop = true ;
226235 this .getServer ().getPluginManager ().disablePlugin (this );
227236 }
237+
238+ public boolean isEmergencyStop () {
239+ return emergencyStop ;
240+ }
228241}
0 commit comments