Examples of PluginDescriptionFile


Examples of org.bukkit.plugin.PluginDescriptionFile

  {

    File file = new File(this.getDataFolder() + File.separator + CONFIG_FILE);
    General.config = new Config(file);

    PluginDescriptionFile pdfFile = this.getDescription();

    try
    {

      PluginManager pm = getServer().getPluginManager();

      pm.registerEvent(Event.Type.PLAYER_MOVE, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_TELEPORT, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_LOGIN, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_QUIT, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_ITEM , this.playerListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.BLOCK_DAMAGED, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_PLACED, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_IGNITE, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_BURN, this.blockListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.ENTITY_DAMAGED, this.entityListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.CREATURE_SPAWN, this.entityListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.ENTITY_EXPLODE, this.entityListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.VEHICLE_MOVE, this.vehicleListener, Event.Priority.Normal, this);

     
      getServer().getScheduler().scheduleAsyncRepeatingTask(this, regen, 10, 10);

      registerCommands();
     
      setupEpicZones();
      setupPermissions();
      setupHeroChat();
      setupMultiWorld();

      Log.Write("version " + pdfFile.getVersion() + " is enabled.");

    }
    catch (Throwable e)
    {
      Log.Write(" error starting: " + e.getMessage() +" Disabling plugin");
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    }
  }

  public void onDisable()
  {
    PluginDescriptionFile pdfFile = this.getDescription()
    Log.Write("version " + pdfFile.getVersion() + " is disabled.");
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    File file = new File(folder+File.separator+CONFIG_FILE);
    General.config = new EpicZonesConfig(file);
  }

  public void onEnable() {
    PluginDescriptionFile pdfFile = this.getDescription();

    try {
      // Register events
      PluginManager pm = getServer().getPluginManager();

      setupPermissions();
      checkConfigDir();
      General.config.load();
      General.config.save();
      General.loadZones(this.getDataFolder());

      pm.registerEvent(Event.Type.PLAYER_MOVE, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_TELEPORT, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_LOGIN, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_QUIT, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_COMMAND, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_ITEM , this.playerListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.BLOCK_DAMAGED, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_PLACED, this.blockListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.ENTITY_DAMAGEDBY_ENTITY, this.entityListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.ENTITY_DAMAGEDBY_PROJECTILE, this.entityListener, Event.Priority.Normal, this);
     
      for(Player p:getServer().getOnlinePlayers())
      {
        General.addPlayer(p.getEntityId(), p.getName());
      }

      System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled." );

    } catch (Throwable e) {
      System.out.println( "["+pdfFile.getName()+"]" + " error starting: "+
          e.getMessage()+" Disabling plugin" );
      this.getServer().getPluginManager().disablePlugin(this);
    }
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

          e.getMessage()+" Disabling plugin" );
      this.getServer().getPluginManager().disablePlugin(this);
    }
  }
  public void onDisable() {
    PluginDescriptionFile pdfFile = this.getDescription()
    System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled." );
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    private static String BuildDebugData()
    {
        String result = "";
        EpicZones plugin = General.plugin;
        PluginDescriptionFile pdfFile = plugin.getDescription();

        result = result + "========================================\n";
        result = result + pdfFile.getName() + " Debug Info\n";
        result = result + "Version: " + pdfFile.getVersion() + "\n";
        result = result + "Generated On: " + new Date().toString() + "\n";
        result = result + "========================================\n";
        result = result + "Players Online: " + plugin.getServer().getOnlinePlayers().length + "/" + plugin.getServer().getMaxPlayers() + "\n";

        result = result + "\nNumber of Zones: " + General.myZones.size() + "\n";
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

        for(PluginFeature feature : features) {
          feature.onEnable(this);
        }

          PluginDescriptionFile pdfFile = this.getDescription();
          logInfo( " version " + pdfFile.getVersion() + " is enabled." );
      }
        catch(Throwable e) {
          e.printStackTrace();         
          logSevere("Error intilizing plugin, disabling.");
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

  public void onEnable() {

    File file = new File(this.getDataFolder() + File.separator + CONFIG_FILE);
    General.config = new EpicGatesConfig(file);
   
    PluginDescriptionFile pdfFile = this.getDescription();

    try
    {

      PluginManager pm = getServer().getPluginManager();
     
      pm.registerEvent(Event.Type.PLAYER_MOVE, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_COMMAND, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_LOGIN, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_QUIT, this.playerListener, Event.Priority.Monitor, this);
     
      setupEpicGates();
      setupPermissions();
     
      System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled." );

    }
    catch (Throwable e)
    {
      System.out.println( "["+pdfFile.getName()+"]" + " error starting: "+
          e.getMessage() +" Disabling plugin" );
      this.getServer().getPluginManager().disablePlugin(this);
    }
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    }
  }

  public void onDisable()
  {
    PluginDescriptionFile pdfFile = this.getDescription()
    System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled." );
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

     
      pm.registerEvent(Event.Type.BLOCK_DAMAGED, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_PLACED, this.blockListener, Event.Priority.Normal, this);
     
     
      PluginDescriptionFile pdfFile = this.getDescription();
      System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled." );
       
    }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    JavaPluginLoader pluginLoader = (JavaPluginLoader) parent
        .getPluginLoader();
    PluginClassLoader pluginClassLoader = new PluginClassLoader(
        pluginLoader, new java.net.URL[] {}, classLoader.getParent());
    String version = com.nijikokun.bukkit.Permissions.Permissions.version;
    PluginDescriptionFile description = new PluginDescriptionFile(
        "Permissions", version,
        "com.nijikokun.bukkit.Permissions.Permissions");

    com.nijikokun.bukkit.Permissions.Permissions permissions = new com.nijikokun.bukkit.Permissions.Permissions();
    permissions.doInitialize(pluginLoader, Bukkit.getServer(), description,
        null, null, pluginClassLoader);
    try {
      permissions.onLoad();

      PermissionBridge bridge = (PermissionBridge) permissions
          .getHandler();
      bridge.permissions = parent;
    } catch (RuntimeException e) {
      Logger.getLogger("Minecraft")
          .warning(
              "["
                  + parent.getDescription().getName()
                  + "] Exception attempting to initialize compatibility layer");
    }

    // use reflection to add the pseudo-Permissions plugin to the
    // PluginManager
    PluginManager pluginManager = Bukkit.getServer().getPluginManager();
    List<Plugin> plugins = getField(pluginManager, "plugins");
    Map<String, Plugin> lookupNames = getField(pluginManager, "lookupNames");
    plugins.add(permissions);
    lookupNames.put(description.getName(), permissions);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.