Package me.totalfreedom.data
Class ModuleRegistry
java.lang.Object
me.totalfreedom.data.ModuleRegistry
A registry for modules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModule(org.bukkit.plugin.java.JavaPlugin plugin) Adds a module to the registry.<T extends org.bukkit.plugin.java.JavaPlugin>
ModuleProvider<T>getProvider(Class<T> clazz) Gets a module from the registry wrapped in aModuleProvider.voidremoveModule(org.bukkit.plugin.java.JavaPlugin plugin) Removes a module from the registry.
-
Constructor Details
-
ModuleRegistry
public ModuleRegistry()Creates a new module registry.
-
-
Method Details
-
addModule
public void addModule(org.bukkit.plugin.java.JavaPlugin plugin) Adds a module to the registry.- Parameters:
plugin- The module to add.
-
removeModule
public void removeModule(org.bukkit.plugin.java.JavaPlugin plugin) Removes a module from the registry.- Parameters:
plugin- The module to remove.
-
getProvider
Gets a module from the registry wrapped in aModuleProvider.- Type Parameters:
T- The type of the module.- Parameters:
clazz- The class of the module.- Returns:
- The module.
-