Hello, I am improving my plugin, ChatControl, which is using 8+ dependencies (other bukkit plugins). The problem was that the code was too messy and chaotic so I decided to recode it, but it is not so much better now. This is an example class that hooks into other bukkit plugin: http://pastebin.com/4pJZu4AR but the static method is called upon first class reload and I need it to be called on plugin enable, which is done by this unfortunate way: Code (Text): private void setupDependencies() { if (AuthMeHook.HOOKED); if (EssentialsHook.HOOKED); if (ProtocolLibHook.HOOKED); if (MultiverseHook.HOOKED); if (RushCoreHook.HOOKED); if (SimpleClansHook.HOOKED); if (TownyHook.HOOKED); if (VaultHook.HOOKED); //etc.. } Do you have any advice on improval? How do you manage many dependencies? Notice I would like to keep the static access.
Static boolean...static blocks. The former is bad practice since you shouldn't need to use the static access. The latter is a code smell.
Yes, remove the static part. It will both make your reloads easier and improve the quality of your plugin.
Thanks, can you provide me same example? I would like to have dependency management in one class, not like it was before that 2/3 was in ChatFormatter and 1/3 in the main class.
Why the static access degrades the plugin quality? Reload is not fully supported, either, and so far I did not get any problems with the new system.
http://www.spigotmc.org/threads/getting-main-class-plugin-without-static.65688/ - a recent thread which treats why you shouldn't rely on static in most cases (as it's overly used)
Kinda better now? https://github.com/kangarko/ChatControl/commit/1dd8d4de76349d6d6f97b588adf81781e9508a31