예제 #1
1
  public void onEnable() {
    // Setup Permissions
    DPPermissionsHandler.getPermissions();

    // Load config.yml
    config.loadConfig();

    // Read plugin.yml
    pdfFile = this.getDescription();

    // Register commands
    commandHandler.setupCmds();

    // Get PluginManager
    PluginManager pm = getServer().getPluginManager();

    // LogBlock API
    final Plugin plugin = pm.getPlugin("LogBlock");
    if (plugin != null) lbconsumer = ((LogBlock) plugin).getConsumer();

    // Register events
    pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Highest, this);
    pm.registerEvent(Event.Type.VEHICLE_DESTROY, vehicleListener, Event.Priority.Highest, this);

    // Register event for MultiVerse support
    pm.registerEvent(Event.Type.WORLD_LOAD, worldListener, Event.Priority.Monitor, this);

    // Inform that plugin has been enabled
    log.info(LOG_PREFIX + "v" + pdfFile.getVersion() + " enabled.");
  }
예제 #2
0
 public void onDisable() {
   // Inform that plugin has been disabled
   log.info(LOG_PREFIX + "v" + pdfFile.getVersion() + " disabled.");
 }