| Constructor and Description |
|---|
ModuleManager(org.bukkit.plugin.java.JavaPlugin plugin) |
ModuleManager(org.bukkit.plugin.java.JavaPlugin plugin,
String moduleDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
disableModule(@NotNull Module module)
Disables the given module.
|
void |
disableModule(@NotNull String name)
Disables a module with the given name.
|
void |
disableModules()
Disables all loaded modules.
|
void |
enableModule(@NotNull Module module)
Enables the given module.
|
void |
enableModule(@NotNull String name)
Enables the module with name.
|
void |
enableModules()
Enables all the loaded modules.
|
protected org.bukkit.command.CommandMap |
getCommandMap() |
@Nullable Module |
getDisabledModule(Module module)
Gets the module (disabled)
|
@Nullable Module |
getDisabledModule(String name)
Gets the module with name (disabled)
|
@NotNull List<Module> |
getDisabledModules()
Gets all the inactive modules from this manager.
|
@Nullable Module |
getEnabledModule(String name)
Gets the enabled module with the given name.
|
@NotNull List<Module> |
getEnabledModules()
Gets all the active modules from this manager.
|
File |
getModuleFolder() |
@NotNull List<Module> |
getModules()
Gets all modules loaded by the manager.
|
boolean |
hasDisabledModule(Module module)
Checks to see if the given module is disabled.
|
boolean |
hasDisabledModule(String name)
Checks to see if the given module is disabled.
|
boolean |
hasEnabledModule(Module module)
Returns whether the given module is loaded.
|
boolean |
hasEnabledModule(String name)
Returns whether the given module with name is loaded.
|
<T extends Module> |
loadModuleFromClass(@NotNull String name,
Class<T> clazz)
Loads the modules from the given class.
|
protected void |
loadModuleJar(File file) |
void |
loadModules() |
void |
reloadModule(@NotNull Module module)
Reloads the given module.
|
void |
reloadModule(@NotNull String name)
Reloads a given module with the name.
|
public ModuleManager(org.bukkit.plugin.java.JavaPlugin plugin)
public ModuleManager(org.bukkit.plugin.java.JavaPlugin plugin,
String moduleDir)
public <T extends Module> void loadModuleFromClass(@NotNull @NotNull String name, Class<T> clazz)
T - Any object that is, or subclasses Module.name - The name to be used for the module.clazz - The class of the Modulepublic void loadModules()
protected void loadModuleJar(File file)
public void enableModules()
loadModuleFromClass(String, Class)public void disableModule(@NotNull
@NotNull Module module)
module - The module to disable.public void disableModule(@NotNull
@NotNull String name)
name - The name of the module to disable.public void disableModules()
public void enableModule(@NotNull
@NotNull Module module)
module - The module to be enabled.public void enableModule(@NotNull
@NotNull String name)
name - The name of the module to enable.@Nullable public @Nullable Module getEnabledModule(String name)
name - The name of the module.@Nullable public @Nullable Module getDisabledModule(Module module)
module - The module to get.@Nullable public @Nullable Module getDisabledModule(String name)
name - The module with name to get.public boolean hasDisabledModule(Module module)
module - The module to check if disabled.public boolean hasDisabledModule(String name)
name - The name of the module to check if disabled.public void reloadModule(@NotNull
@NotNull Module module)
module - The module to reload. Note that the module must be enabled
in order to reload.public void reloadModule(@NotNull
@NotNull String name)
name - The name of the module to reload.public boolean hasEnabledModule(Module module)
module - The module to check for.public boolean hasEnabledModule(String name)
name - The name of the module to check for.protected org.bukkit.command.CommandMap getCommandMap()
@NotNull public @NotNull List<Module> getModules()
public File getModuleFolder()
@NotNull public @NotNull List<Module> getEnabledModules()
Copyright © 2020. All rights reserved.