Package org.bukkit.plugin

Examples of org.bukkit.plugin.Plugin


    // add shutdown function
    CommandsEX.onDisableFunctions.add("com.github.zathrus_writer.commandsex.helpers.Nametags#####onDisable");
  }

  public static void init(CommandsEX plugin){
    Plugin pl = Bukkit.getPluginManager().getPlugin("TagAPI");
    if (pl != null && pl.isEnabled()){
      tagAPIPresent = true;
    }
   
    new Nametags();
  }
View Full Code Here


public class CombatTag {

    private static CombatTagApi combatTagApi = null;

    public CombatTag(){
        Plugin plugin = Bukkit.getPluginManager().getPlugin("CombatTag");

        if (plugin != null){
            combatTagApi = new CombatTagApi((com.trc202.CombatTag.CombatTag) plugin);
        }
    }
View Full Code Here

        }
        return has((Player) sender, s);
    }
   
    private void setupVault() {
        Plugin vaultPlugin = this.getServer().getPluginManager().getPlugin("Vault");
        if (vaultPlugin == null) {
            Messenger.warning("Vault was not found. Economy rewards will not work!");
            return;
        }
       
View Full Code Here

            Messenger.warning("Vault found, but no economy plugin detected. Economy rewards will not work!");
        }
    }
   
    private void setupMagicSpells() {
        Plugin spells = this.getServer().getPluginManager().getPlugin("MagicSpells");
        if (spells == null) return;

        Messenger.info("MagicSpells found, loading config-file.");
        this.getServer().getPluginManager().registerEvents(new MagicSpellsListener(this), this);
    }
View Full Code Here

                if(node == null)
                    return true;

                if(this.Permissions == null)
                    if(!this.testedPermissions) {
                        Plugin Perms = Server.getPluginManager().getPlugin("Permissions");
                       
                        if (Perms != null) {
                            if (Perms.isEnabled()) {
                                this.Permissions = ((Permissions)Perms);
                                System.out.println("[iConomy] hooked into Permissions.");
                            }
                        }
View Full Code Here

    }

    class ServerListener implements org.bukkit.event.Listener {
        @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();
View Full Code Here

            Class.forName("com.nijikokun.bukkit.Permissions.Permissions");
        } catch (ClassNotFoundException e) {
            return null;
        }

        Plugin plugin = pluginManager.getPlugin("Permissions");

        // Check if plugin is loaded and has Permissions interface
        if (plugin == null || !(plugin instanceof Permissions)) {
            return null;
        }
View Full Code Here

    reportDetailed(sender, reportBuilder.build());
  }
 
  @Override
  public void reportDetailed(Object sender, Report report) {
    final Plugin plugin = pluginReference.get();
    final int errorCount = internalErrorCount.incrementAndGet();
   
    // Do not overtly spam the server!
    if (errorCount > getMaxErrorCount()) {
      // Only allow the error count at rare occations
      if (isPowerOfTwo(errorCount)) {
        // Permit it - but print the number of exceptions first
        reportWarning(this, Report.newBuilder(REPORT_EXCEPTION_COUNT).messageParam(errorCount).build());
      } else {
        // NEVER SPAM THE CONSOLE
        return;
      }
    }
   
    // Secondary rate limit
    if (!canReport(report)) {
      return;
    }
   
    StringWriter text = new StringWriter();
    PrintWriter writer = new PrintWriter(text);

    // Helpful message
    writer.println("[" + pluginName + "] INTERNAL ERROR: " + report.getReportMessage());
      writer.println("If this problem hasn't already been reported, please open a ticket");
      writer.println("at " + supportURL + " with the following data:");
     
      // Now, let us print important exception information
    writer.println("          ===== STACK TRACE =====");

    if (report.getException() != null) {
      report.getException().printStackTrace(writer);
     
    } else if (detailedReporting) {
      printCallStack(writer);
    }
   
    // Data dump!
    writer.println("          ===== DUMP =====");
   
    // Relevant parameters
    if (report.hasCallerParameters()) {
      printParameters(writer, report.getCallerParameters());
    }
   
    // Global parameters
    for (String param : globalParameters()) {
      writer.println(SECOND_LEVEL_PREFIX + param + ":");
      writer.println(addPrefix(getStringDescription(getGlobalParameter(param)),
          SECOND_LEVEL_PREFIX + SECOND_LEVEL_PREFIX));
    }
   
    // Now, for the sender itself
    writer.println("Sender:");
    writer.println(addPrefix(getStringDescription(sender), SECOND_LEVEL_PREFIX));
   
    // And plugin
    if (plugin != null) {
      writer.println("Version:");
      writer.println(addPrefix(plugin.toString(), SECOND_LEVEL_PREFIX));
    }
   
    // Add the server version too
    if (Bukkit.getServer() != null) {
      writer.println("Server:");
View Full Code Here

   * @param pluginName - the non-null name of the plugin to retrieve.
   * @return The retrieved plugin.
   * @throws PluginNotFoundException If a plugin with the given name cannot be found.
   */
  private Plugin getPlugin(String pluginName) {
    Plugin plugin = getPluginOrDefault(pluginName);
   
    // Ensure that the plugin exists
    if (plugin != null)
      return plugin;
    else
View Full Code Here

      return true;
    }
   
    // Recurse through their dependencies
    for (String childName : childNames) {
      Plugin childPlugin = getPluginOrDefault(childName);
     
      if (childPlugin != null && hasDependency(childPlugin, dependency, checking)) {
        return true;
      }
    }
View Full Code Here

TOP

Related Classes of org.bukkit.plugin.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.