Cannot hook custom requirements
alexrallen opened this issue ยท 3 comments
I have this code:
Plugin ar = getServer().getPluginManager().getPlugin("Autorank");
Autorank arp = (Autorank) ar;
API arapi = arp.getAPI();
arp.registerRequirement("zkills", TimeRequirement.class);
Util.log("Hooked into Autorank");
in my OnEnable() method and it simply does not register, I know the class is good because I am using the example class from the API Docs page. It gives no error messages until a player runs /ar check when their current rankup requires zkills.
I just now realised there might be a huge bug in the way external requirements and results are loaded. Because in order for you to do a getPlugin() on Autorank it has to be fully loaded. But if it's fully loaded it already read the config and did know about the custom requirement at that time.
I hope @Staartvin can look into this, if this is in fact the issue then I'm to blame :P
Yes, I alreay knew of this problem, but hadn't thought of a solution. I think I'll repeat the reading of the configs after loadup.