Example #1
0
  @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.");
        }
      }
    }
  }
Example #2
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginDisable(final PluginDisableEvent event) {
   if (plugin.iConomy != null) {
     if (event.getPlugin().getDescription().getName().equals("iConomy")) {
       plugin.iConomy = null;
       System.out.println("[MyPlugin] un-hooked from iConomy.");
     }
   }
 }
Example #3
0
 public server(Core plugin) {
   this.plugin = plugin;
   plugin.getServer().getPluginManager().registerEvents(this, plugin);
 }