Ejemplo n.º 1
0
 public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
   if (cmd.getName().equalsIgnoreCase("hbg")) {
     if (args.length > 0) {
       CommandHandler.handleCommand(this, sender, args);
     } else {
       ChatColor YELLOW = ChatColor.YELLOW;
       ChatColor BLUE = ChatColor.BLUE;
       ChatColor GREEN = ChatColor.GREEN;
       sender.sendMessage(
           YELLOW
               + "HungerBarGames version "
               + BLUE
               + getDescription().getVersion()
               + YELLOW
               + ".");
       sender.sendMessage(
           YELLOW
               + "Made by "
               + GREEN
               + "tomjw64"
               + YELLOW
               + " and "
               + GREEN
               + "HaydenCappadona"
               + YELLOW
               + "!");
       sender.sendMessage(
           YELLOW + "Type " + BLUE + "/hbg help" + YELLOW + " for HungerBarGames commands!");
     }
   }
   return true;
 }
Ejemplo n.º 2
0
  @Override
  public void onEnable() {
    plugin = this;

    // Load all YML files
    ConfigManager.loadConfig(this);
    ChestClassManager.loadConfig(this);
    DataManager.loadDatabase(this);
    PlayerDataManager.loadPlayerData(this);

    // Load listeners
    if (ConfigManager.getPvP()) {
      new AntiPvPListener();
    }
    new ArenaProtectionListener();
    new PlayerRespawnListener();

    // Load commands
    CommandHandler.loadCommands(this);

    PluginDescriptionFile pdf = getDescription();
    logger.info("[" + pdf.getName() + "] version " + pdf.getVersion() + " is enabled!");
  }