@EventHandler(priority = EventPriority.MONITOR) public void onPluginEnable(final PluginEnableEvent event) { if (plugin.iConomy == null) { Plugin iConomy = plugin.getServer().getPluginManager().getPlugin("iConomy"); if (iConomy != null) { if (iConomy.isEnabled() && iConomy.getClass().getName().equals("com.iConomy.iConomy")) { plugin.iConomy = (iConomy) iConomy; System.out.println("[MyPlugin] hooked into iConomy."); } } } }
public server(Core plugin) { this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); }