Examples of PluginDescriptionFile


Examples of org.bukkit.plugin.PluginDescriptionFile

    super();
  }

  public void onEnable() {
    setupPermissions();
    PluginDescriptionFile pdfFile = this.getDescription();
    this.version = pdfFile.getVersion();
    this.name = pdfFile.getName();
    PluginManager pm = getServer().getPluginManager();
    pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener,
        Priority.Normal, this);
    pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener,
        Priority.Normal, this);
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    }
  }

  public void onDisable() {
    // Animation.save(); TODO
    PluginDescriptionFile pdfFile = this.getDescription();
    translationplugin = null;
    permissionhandler = null;
    this.getServer()
        .getLogger()
        .info(pdfFile.getName() + " version " + pdfFile.getVersion()
            + " is disabled!");
  }
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

      Logger log = Logger.getLogger("Minecraft");
      public PropertyManager config = new PropertyManager("config.properties", this, "MultiCurrency: Config")
      public String noPerms;
    
      public void onEnable(){
         PluginDescriptionFile descrip = getDescription();
         log.info(descrip.getFullName() + " by " + descrip.getAuthors().toString());
         CurrencyList.setPlugin(this);
         PluginManager pm = getServer().getPluginManager();
         MoneyListener money = new MoneyListener();
         //pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, money, Event.Priority.Normal, this);
         pm.registerEvent(Event.Type.PLAYER_LOGIN, money, Event.Priority.Normal, this);
View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

    /**
     * Generic method that posts a plugin to the metrics website
     */
    private void postPlugin(final boolean isPing) throws IOException {
        // Server software specific section
        PluginDescriptionFile description = plugin.getDescription();
        String pluginName = description.getName();
        boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
        String pluginVersion = description.getVersion();
        String serverVersion = Bukkit.getVersion();
        int playersOnline = Bukkit.getServer().getOnlinePlayers().length;

        // END server software specific section -- all code below does not use any code outside of this class / Java

View Full Code Here

Examples of org.bukkit.plugin.PluginDescriptionFile

  private static CommandHandler cmCommandHandler = new CM();

  public void onEnable()
  {

    PluginDescriptionFile pdfFile = this.getDescription();

    try
    {

      Current.Plugin = this;

      PluginManager pm = getServer().getPluginManager();

      pm.registerEvent(Event.Type.BLOCK_BREAK, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_PLACE, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.SIGN_CHANGE, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_BURN, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_FADE, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_FORM, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_FROMTO, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.BLOCK_SPREAD, this.blockListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.LEAVES_DECAY, this.blockListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.PLAYER_INTERACT, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_LOGIN, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_JOIN, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_PRELOGIN, this.playerListener, Event.Priority.Normal, this);
      pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, this.playerListener, Event.Priority.Highest, this);
      pm.registerEvent(Event.Type.PLAYER_RESPAWN, this.playerListener, Event.Priority.Normal, this);

      pm.registerEvent(Event.Type.ENTITY_DEATH, this.entityListener, Event.Priority.Normal, this);

      registerCommands();

      MapData.LoadMaps();
      MapEntranceData.LoadMapEntrances();

      for (World world : this.getServer().getWorlds())
      {
        for (Player player : world.getPlayers())
        {
          String worldName = world.getName().replace("_" + player.getName(), "");
          Map map = Current.Maps.get(worldName.toLowerCase());
          if (map != null)
          {
            Current.GameWorlds.add(world.getName());
            GameStateData.Load(map, player, false);
          }
        }
      }

      setupSpout(pm);

      getServer().getScheduler().scheduleAsyncRepeatingTask(this, processObjectives, 100, 50);
      getServer().getScheduler().scheduleAsyncRepeatingTask(this, monitorEnvironment, 100, 50);

      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()
  {
    getServer().getScheduler().cancelTasks(this);
    processObjectives = null;
    monitorEnvironment = null;
    PluginDescriptionFile pdfFile = this.getDescription();
    System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled.");
  }
View Full Code Here

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_LOGIN, this.playerListener, Event.Priority.Monitor, this);
      pm.registerEvent(Event.Type.PLAYER_QUIT, this.playerListener, Event.Priority.Monitor, this);

      registerCommands();
      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

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

          PluginDescriptionFile pdfFile = this.getDescription();
          logInfo( " version " + pdfFile.getVersion() + " is enabled." );
      }
        catch(EnableError e) {
          logSevere("Error intilizing plugin, disabling." + e.toString());

          this.getServer().getPluginManager().disablePlugin(this);
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
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.