@EventHandler
 public void onPluginEnable(PluginEnableEvent e) {
   if (!e.getPlugin().getName().equalsIgnoreCase("vault")) {
     return;
   }
   inject(e.getPlugin());
 }
Пример #2
0
 @Override
 public void onPluginEnable(PluginEnableEvent event) {
   if (event.getPlugin().isEnabled()) { // double-check
     // Log(event.getPlugin().getDescription().getName());
     if (event.getPlugin().getDescription().getName().equals("iConomy")) {
       if (BetterShop.iConomy == null) {
         BetterShop.iConomy = (iConomy) event.getPlugin();
         iBank = iConomy.getBank();
         // config.currency = iBank.getCurrency();
         Log("Attached to iConomy.");
       }
     } else if (event.getPlugin().getDescription().getName().equals("BOSEconomy")) {
       if (BetterShop.economy == null) {
         BetterShop.economy = (BOSEconomy) event.getPlugin();
         Log("Attached to BOSEconomy");
       }
     } else if (event.getPlugin().getDescription().getName().equals("Permissions")) {
       if (BetterShop.Permissions == null) {
         BetterShop.Permissions = (Permissions) event.getPlugin();
         Log("Attached to Permissions or something close enough to it");
       }
     } else if (event.getPlugin().getDescription().getName().equals("Help")) {
       shop.registerHelp();
     } else if (event.getPlugin().getDescription().getName().equals("MinecraftIM")) {
       if (BetterShop.messenger == null) {
         messenger = (MinecraftIM) event.getPlugin();
         // messenger.registerMessageHandler(shop);
         Log("linked to MinecraftIM");
       }
     }
   }
 }
Пример #3
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (event.getPlugin().getDescription().getName().equals("Register")
       && packageExists("com.nijikokun.register.payment.Methods")) {
     if (!Methods.hasMethod()) {
       try {
         Method m = Methods.class.getMethod("addMethod", Methods.class);
         m.setAccessible(true);
         m.invoke(null, "Vault", new net.milkbowl.vault.VaultEco());
         if (!Methods.setPreferred("Vault")) {
           log.info("Unable to hook register");
         } else {
           log.info("[Vault] - Successfully injected Vault methods into Register.");
         }
       } catch (SecurityException e) {
         log.info("Unable to hook register");
       } catch (NoSuchMethodException e) {
         log.info("Unable to hook register");
       } catch (IllegalArgumentException e) {
         log.info("Unable to hook register");
       } catch (IllegalAccessException e) {
         log.info("Unable to hook register");
       } catch (InvocationTargetException e) {
         log.info("Unable to hook register");
       }
     }
   }
 }
Пример #4
0
 @Override
 public void onPluginEnable(PluginEnableEvent event) {
   if (TombWorker.getPermission() == null) {
     Plugin Permissions = TombPlugin.getBukkitServer().getPluginManager().getPlugin("Permissions");
     if (Permissions != null) {
       if (Permissions.isEnabled()) {
         TombWorker.setPermission(((Permissions) Permissions).getHandler());
         System.out.println("[Tomb] Successfully linked with Permissions.");
       }
     }
   }
   if (TombWorker.getPayement() == null) {
     // Check to see if we need a payment method
     if (!this.Methods.hasMethod()) {
       if (this.Methods.setMethod(event.getPlugin())) {
         // You might want to make this a public variable inside your MAIN class public Method
         // Method = null;
         // then reference it through this.plugin.Method so that way you can use it in the rest of
         // your plugin ;)
         TombWorker.setMethod(this.Methods.getMethod());
         System.out.println(
             "[Tomb] Payment method found ("
                 + TombWorker.getPayement().getName()
                 + " version: "
                 + TombWorker.getPayement().getVersion()
                 + ")");
       }
     }
   }
 }
 @EventHandler
 public void onPluginEnable(PluginEnableEvent event) {
   Plugin p = event.getPlugin();
   String name = p.getDescription().getName();
   if (name.equals("dynmap") || name.equals("Essentials")) {
     if (dynmap.isEnabled() && citizens.isEnabled()) activate();
   }
 }
Пример #6
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (API == null) {
     Plugin permPlugin = event.getPlugin();
     if (permPlugin.getDescription().getName().equals("DroxPerms")) {
       API = ((DroxPerms) permPlugin).getAPI();
       log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name));
     }
   }
 }
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(final PluginEnableEvent event) {
   if (event.getPlugin().getName().equals("EssentialsChat")) {
     ess.getSettings().setEssentialsChatActive(true);
   }
   ess.getPermissionsHandler().setUseSuperperms(ess.getSettings().useBukkitPermissions());
   ess.getPermissionsHandler().checkPermissions();
   ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
   if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager())) {
     ess.getLogger()
         .log(
             Level.INFO,
             "Payment method found ("
                 + Methods.getMethod().getLongName()
                 + " version: "
                 + ess.getPaymentMethod().getMethod().getVersion()
                 + ")");
   }
 }
 /** @param event */
 @EventHandler
 public void onPluginEnable(PluginEnableEvent event) {
   // worldEdit - inspired by MultiversePortals
   if (event.getPlugin().getDescription().getName().equals("WorldEdit")) {
     SimpleSpleef.setWorldEditAPI(
         new WorldEditAPI(
             (WorldEditPlugin)
                 SimpleSpleef.getPlugin().getServer().getPluginManager().getPlugin("WorldEdit")));
     SimpleSpleef.log.info("[SimpleSpleef] Found WorldEdit. Using it for selections.");
   }
 }
Пример #9
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (economy.economy == null) {
     Plugin wecon = event.getPlugin();
     if (wecon.isEnabled() && wecon.getDescription().getName().equals("WorldEconomy")) {
       economy.economy = (WorldEconomyPlugin) wecon;
       log.info(
           String.format(
               "[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
     }
   }
 }
Пример #10
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (perms == null) {
     Plugin p = event.getPlugin();
     if (p.getDescription().getName().equals("Starburst") && p.isEnabled()) {
       perms = (StarburstPlugin) p;
       log.info(
           String.format(
               "[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
     }
   }
 }
Пример #11
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (mChat == null) {
     Plugin chat = event.getPlugin();
     if (chat.getDescription().getName().equals("mChatSuite")) {
       mChat = (mChatSuite) chat;
       log.info(
           String.format(
               "[%s][Chat] %s hooked.", plugin.getDescription().getName(), "mChatSuite"));
     }
   }
 }
Пример #12
0
  @Override
  public void onPluginEnable(PluginEnableEvent event) {
    if (economyPlugin.isInitialized()) {
      return;
    }

    Plugin plugin = event.getPlugin();

    if (plugin instanceof LWCPlugin) {
      economyPlugin.init();
    }
  }
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (manager == null) {
     Plugin permPlugin = event.getPlugin();
     if (permPlugin.getDescription().getName().equals(name)) {
       totalperms = (TotalPermissions) permPlugin;
       manager = totalperms.getManager();
       log.info(
           String.format(
               "[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
     }
   }
 }
 @EventHandler
 public void onPluginEnable(PluginEnableEvent event) {
   Plugin plugin = event.getPlugin();
   String name = plugin.getDescription().getName();
   if (plugin instanceof PermissionsProvider) {
     setPluginPermissionsResolver(plugin);
   } else if ("permissions".equalsIgnoreCase(name)
       || "permissionsex".equalsIgnoreCase(name)
       || "bpermissions".equalsIgnoreCase(name)
       || "groupmanager".equalsIgnoreCase(name)) {
     load();
   }
 }
 @EventHandler(priority = EventPriority.HIGHEST)
 public void onPluginEnable(final PluginEnableEvent event) {
   final String PluginName = event.getPlugin().getDescription().getName();
   if (plugin != null) {
     if (PluginName.equals("Vault")) {
       MonsterIRC.getHookManager().setPermissionsHook();
       MonsterIRC.getHandleManager()
           .setPermissionsHandler(MonsterIRC.getHookManager().getPermissionsHook());
       MonsterIRC.getHookManager().setChatHook();
     } else if (PluginName.equals("TownyChat")) {
       MonsterIRC.getHookManager().setTownyChatHook();
     }
   }
 }
Пример #16
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (event.getPlugin().getDescription().getName().equals("Xperms")) {
     Plugin perms = event.getPlugin();
     try {
       if (Double.valueOf(perms.getDescription().getVersion()) < 1.1) {
         log.info(
             String.format(
                 "[%s] [Permission] %s Current version is not compatible with vault! Please Update!",
                 plugin.getDescription().getName(), name));
       }
     } catch (NumberFormatException e) {
       // version is first release, numbered 1.0.0
       log.info(
           String.format(
               "[%s] [Permission] %s Current version is not compatibe with vault! Please Update!",
               plugin.getDescription().getName(), name));
     }
     permission.perms = (Xmain) perms;
     log.info(
         String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
   }
 }
Пример #17
0
 /**
  * Check for disabled plugin to re add the associated replacer
  *
  * @param enableEvent the enable event
  */
 @EventHandler
 public void onPluginEnable(PluginEnableEvent enableEvent) {
   // Register the listener back again if the plugin is available
   final String enablePluginName = enableEvent.getPlugin().getName();
   final Map<Class<? extends VariableReplaceAdapter<?>>, String> defaults =
       replaceManager.getDefaults();
   for (Map.Entry<Class<? extends VariableReplaceAdapter<?>>, String> entry :
       defaults.entrySet()) {
     final String pluginName = entry.getValue();
     if (enablePluginName.equals(entry.getValue())) {
       replaceManager.registerDefault(entry.getKey(), pluginName);
     }
   }
 }
 @EventHandler(priority = EventPriority.MONITOR)
 public void onPluginEnable(PluginEnableEvent event) {
   if (this.permission.perms == null) {
     Plugin perms = event.getPlugin();
     if (perms.getDescription().getName().equals("SimplyPerms")) {
       this.permission.perms = ((SimplyPlugin) perms).getAPI();
       Permission_SimplyPerms.log.info(
           String.format(
               "[%s][Permission] %s hooked.",
               new Object[] {
                 Permission_SimplyPerms.this.plugin.getDescription().getName(), "SimplyPerms"
               }));
     }
   }
 }
Пример #19
0
 @Override
 public void onPluginEnable(PluginEnableEvent event) {
   if (!this.methods.hasMethod()) {
     if (this.methods.setMethod(event.getPlugin())) {
       Citizens.setMethod(this.methods.getMethod());
       EconomyManager.setServerEconomyEnabled(true);
       Messaging.log(
           "Payment method found ("
               + methods.getMethod().getName()
               + " version: "
               + methods.getMethod().getVersion()
               + ")");
     }
   }
 }
Пример #20
0
 @EventHandler
 public void onPluginEnable(PluginEnableEvent event) {
   this.checkForMultiverse(event.getPlugin());
 }
Пример #21
0
 @EventHandler(priority = EventPriority.NORMAL)
 public void onPluginEnable(PluginEnableEvent event) {
   this.pluginEnable(event.getPlugin().getName());
 }
 public void onPluginEnable(PluginEnableEvent event) {
   plugin.log.info("Plugin detected: %s", event.getPlugin().toString());
 }
Пример #23
0
 @EventHandler
 public void onPluginEnabled(PluginEnableEvent e) {
   onPluginEnabled(e.getPlugin());
 }