Made moduleloader notify modules on disable
This commit is contained in:
parent
b083135a7a
commit
0fe41a40a9
@ -21,7 +21,7 @@ import com.redstoner.modules.Module;
|
||||
/** The module loader, mother of all modules. Responsible for loading and taking care of all modules.
|
||||
*
|
||||
* @author Pepich */
|
||||
@Version(major = 1, minor = 1, revision = 3, compatible = -1)
|
||||
@Version(major = 1, minor = 2, revision = 0, compatible = -1)
|
||||
public final class ModuleLoader implements CoreModule
|
||||
{
|
||||
private static ModuleLoader instance;
|
||||
@ -169,4 +169,13 @@ public final class ModuleLoader implements CoreModule
|
||||
Utils.sendMessage(sender, " §7", "For more detailed information, consult the debugger.");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void disableModules()
|
||||
{
|
||||
for (Module m : modules)
|
||||
{
|
||||
if (m.enabled())
|
||||
m.onDisable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import com.redstoner.modules.warn.Warn;
|
||||
/** Main class. Duh.
|
||||
*
|
||||
* @author Pepich */
|
||||
@Version(major = 1, minor = 1, revision = 6, compatible = -1)
|
||||
@Version(major = 1, minor = 2, revision = 0, compatible = -1)
|
||||
public class Main extends JavaPlugin
|
||||
{
|
||||
public static JavaPlugin plugin;
|
||||
@ -42,4 +42,10 @@ public class Main extends JavaPlugin
|
||||
// And enable them
|
||||
ModuleLoader.enableModules();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
ModuleLoader.disableModules();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user