Move to Master #8
@ -5,7 +5,6 @@ import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
@ -40,7 +39,7 @@ import net.nemez.chatapi.click.Message;
|
||||
/** The module loader, mother of all modules. Responsible for loading and taking care of all modules.
|
||||
*
|
||||
* @author Pepich */
|
||||
@Version(major = 5, minor = 0, revision = 0, compatible = 5)
|
||||
@Version(major = 5, minor = 1, revision = 0, compatible = 5)
|
||||
public final class ModuleLoader implements CoreModule
|
||||
{
|
||||
private static ModuleLoader instance;
|
||||
@ -370,8 +369,7 @@ public final class ModuleLoader implements CoreModule
|
||||
{
|
||||
HandlerList.unregisterAll((Listener) module);
|
||||
}
|
||||
String[] commands = getAllHooks(module).toArray(new String[] {});
|
||||
CommandManager.unregisterAll(commands);
|
||||
CommandManager.unregisterAllWithFallback(module.getClass().getSimpleName());
|
||||
try
|
||||
{
|
||||
URLClassLoader loader = loaders.get(module);
|
||||
@ -387,19 +385,6 @@ public final class ModuleLoader implements CoreModule
|
||||
}
|
||||
}
|
||||
|
||||
private static ArrayList<String> getAllHooks(Module module)
|
||||
{
|
||||
ArrayList<String> commands = new ArrayList<>();
|
||||
for (Method m : module.getClass().getMethods())
|
||||
{
|
||||
Command cmd = m.getDeclaredAnnotation(Command.class);
|
||||
if (cmd == null)
|
||||
continue;
|
||||
commands.add(cmd.hook());
|
||||
}
|
||||
return commands;
|
||||
}
|
||||
|
||||
@Command(hook = "load")
|
||||
public boolean loadModule(CommandSender sender, String name)
|
||||
{
|
||||
|
Reference in New Issue
Block a user