Dynamically loaded modules will have their autolisteners now respected
This commit is contained in:
parent
3ee9f7be1b
commit
5b9537c650
@ -36,7 +36,7 @@ import net.minecraft.server.v1_11_R1.MinecraftServer;
|
|||||||
/** The module loader, mother of all modules. Responsible for loading and taking care of all modules.
|
/** The module loader, mother of all modules. Responsible for loading and taking care of all modules.
|
||||||
*
|
*
|
||||||
* @author Pepich */
|
* @author Pepich */
|
||||||
@Version(major = 3, minor = 1, revision = 3, compatible = 2)
|
@Version(major = 3, minor = 1, revision = 4, compatible = 2)
|
||||||
public final class ModuleLoader implements CoreModule
|
public final class ModuleLoader implements CoreModule
|
||||||
{
|
{
|
||||||
private static ModuleLoader instance;
|
private static ModuleLoader instance;
|
||||||
@ -286,6 +286,10 @@ public final class ModuleLoader implements CoreModule
|
|||||||
module.postEnable();
|
module.postEnable();
|
||||||
}
|
}
|
||||||
Utils.info("Loaded module " + module.getClass().getName());
|
Utils.info("Loaded module " + module.getClass().getName());
|
||||||
|
if (module.getClass().isAnnotationPresent(AutoRegisterListener.class) && (module instanceof Listener))
|
||||||
|
{
|
||||||
|
Bukkit.getPluginManager().registerEvents((Listener) module, Main.plugin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Utils.error("Failed to load module " + module.getClass().getName());
|
Utils.error("Failed to load module " + module.getClass().getName());
|
||||||
|
Reference in New Issue
Block a user