protected void registerCommandHelp(Command command) {
    if (command.description().isEmpty()) {
      return;
    }

    for (Plugin helpPlugin : this.helpPlugins) {
      if (helpPlugin instanceof Help) {
        ((Help) helpPlugin)
            .registerCommand(
                command.name() + " " + command.syntax(),
                command.description(),
                plugin,
                command.isPrimary(),
                command.permission());
      }
    }
  }
Beispiel #2
0
  private void registerHelp() {
    Plugin test = this.getServer().getPluginManager().getPlugin("Help");
    if (test != null) {
      Help helpPlugin = ((Help) test);
      helpPlugin.registerCommand(
          "shoplist [page]", "List shop prices", this, !config.hideHelp, "BetterShop.user.list");
      helpPlugin.registerCommand(
          "shopitems", "compact listing of items in shop", this, "BetterShop.user.list");
      helpPlugin.registerCommand(
          "shopkits [page]", "show listing of kits in shop", this, "BetterShop.user.list");
      helpPlugin.registerCommand(
          "shopbuy [item] <amount>",
          "Buy items from the shop",
          this,
          !config.hideHelp,
          "BetterShop.user.buy");
      helpPlugin.registerCommand(
          "shopbuyall [item]", "Buy all that you can hold/afford", this, "BetterShop.user.buy");
      helpPlugin.registerCommand(
          "shopbuystack [item] <amount>", "Buy stacks of items", this, "BetterShop.user.buy");
      helpPlugin.registerCommand(
          "shopbuyagain", "repeat last purchase action", this, "BetterShop.user.buy");
      helpPlugin.registerCommand(
          "shopsell [item] <amount>",
          "Sell items to the shop",
          this,
          !config.hideHelp,
          "BetterShop.user.sell");
      helpPlugin.registerCommand(
          "shopsellstack [item] <amount>", "Sell stacks of items", this, "BetterShop.user.sell");
      helpPlugin.registerCommand(
          "shopsellall <inv> <item..>", "Sell all of your items", this, "BetterShop.user.sell");
      helpPlugin.registerCommand(
          "shopsellagain", "Repeat last sell action", this, "BetterShop.user.sell");
      helpPlugin.registerCommand(
          "shopcheck [item]",
          "Check prices of item[s]",
          this,
          !config.hideHelp,
          "BetterShop.user.check");
      helpPlugin.registerCommand(
          "shophelp [command]",
          "show help on commands",
          this,
          !config.hideHelp,
          "BetterShop.user.help");
      helpPlugin.registerCommand(
          "shopadd [item] [$buy] <$sell>",
          "Add/Update an item",
          this,
          !config.hideHelp,
          "BetterShop.admin.add");
      helpPlugin.registerCommand(
          "shopremove [item]",
          "Remove an item from the shop",
          this,
          !config.hideHelp,
          "BetterShop.admin.remove");
      helpPlugin.registerCommand(
          "shopload",
          "Reload the Configuration & PriceList DB",
          this,
          !config.hideHelp,
          "BetterShop.admin.load");

      helpPlugin.registerCommand(
          "shop restock", "manually restock (if enabled)", this, "BetterShop.admin.restock");
      helpPlugin.registerCommand(
          "shop ver[sion]", "Show Version # and if is current", this, "BetterShop.admin.info");
      helpPlugin.registerCommand(
          "shop backup", "backup current pricelist", this, "BetterShop.admin.backup");
      helpPlugin.registerCommand(
          "shop import [file]",
          "import a file into the pricelist",
          this,
          "BetterShop.admin.backup");
      helpPlugin.registerCommand(
          "shop restore [file]", "restore pricelist from backup", this, "BetterShop.admin.backup");
      helpPlugin.registerCommand(
          "shop update", "manually update bettershop to newest version", this, "OP");

      Log("'Help' support enabled.");
    } // else Log("Help not yet found.");
  }