Example #1
0
  public void onEnable() {

    // Init

    instance = this;
    configDB = new ConfigDB(this);
    itemHandler = new ItemHandler(this);
    api = new API(this);
    playerData = new PlayerData(this);
    recipes = new Recipes(this);

    // Metrics

    try {
      Metrics metrics = new Metrics(this);
      metrics.start();
    } catch (IOException e) {

    }

    // Config startup

    configDB.Startup();

    // Register listeners

    getServer()
        .getPluginManager()
        .registerEvents(
            (Listener) new org.jakub1221.customitems.listeners.BlockListener(this), this);
    getServer()
        .getPluginManager()
        .registerEvents(
            (Listener) new org.jakub1221.customitems.listeners.EntityListener(this), this);
    getServer()
        .getPluginManager()
        .registerEvents(
            (Listener) new org.jakub1221.customitems.listeners.PlayerListener(this), this);

    // Set command executor

    this.getCommand("ci").setExecutor((CommandExecutor) new CmdExecutor(this));

    log.info(Util.editConsole("Plugin loaded! Version " + version + " / Build: " + build));
  }
Example #2
0
  public void onDisable() {

    log.info(Util.editConsole("Plugin stopped!"));
  }