Update /mcstats to use Bukkit CommandAPI. Addresses #628

This commit is contained in:
GJ 2013-02-05 09:30:47 -05:00
parent 81ba0404b2
commit ef7aeb752e
4 changed files with 15 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import com.gmail.nossr50.commands.player.InspectCommand;
import com.gmail.nossr50.commands.player.McabilityCommand;
import com.gmail.nossr50.commands.player.McmmoCommand;
import com.gmail.nossr50.commands.player.McrankCommand;
import com.gmail.nossr50.commands.player.McstatsCommand;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsCommand;
import com.gmail.nossr50.skills.archery.ArcheryCommand;
@ -229,4 +230,16 @@ public final class CommandRegistrationHelper {
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcrank", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
command.setExecutor(new McrankCommand());
}
public static void registerMcstatsCommand() {
List<String> aliasList = new ArrayList<String>();
aliasList.add("stats");
PluginCommand command = mcMMO.p.getCommand("mcstats");
command.setDescription(LocaleLoader.getString("Commands.Description.mcstats"));
command.setPermission("mcmmo.commands.mcstats");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcstats"));
command.setExecutor(new McstatsCommand());
}
}

View File

@ -26,7 +26,6 @@ import com.gmail.nossr50.chat.commands.ACommand;
import com.gmail.nossr50.chat.commands.PCommand;
import com.gmail.nossr50.commands.CommandRegistrationHelper;
import com.gmail.nossr50.commands.player.MccCommand;
import com.gmail.nossr50.commands.player.McstatsCommand;
import com.gmail.nossr50.commands.player.MctopCommand;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
@ -446,7 +445,7 @@ public class mcMMO extends JavaPlugin {
CommandRegistrationHelper.registerMcrefreshCommand();
getCommand("mctop").setExecutor(new MctopCommand());
CommandRegistrationHelper.registerMcrankCommand();
getCommand("mcstats").setExecutor(new McstatsCommand());
CommandRegistrationHelper.registerMcstatsCommand();
// Party commands
getCommand("a").setExecutor(new ACommand());

View File

@ -697,6 +697,7 @@ Commands.Description.mcgod=Toggle mcMMO god-mode on/off
Commands.Description.mcmmo=Show a brief description of mcMMO
Commands.Description.mcrank=Show mcMMO ranking for a player
Commands.Description.mcrefresh=Refresh all cooldowns for mcMMO
Commands.Description.mcstats=Show your mcMMO levels and XP
Commands.Description.mmoedit=Edit mcMMO levels for a user
Commands.Description.Skill=Display detailed mcMMO skill info for {0}
Commands.Description.skillreset=Reset mcMMO levels for a user

View File

@ -49,7 +49,6 @@ commands:
mcgod:
description: Toggle mcMMO god-mode on/off
mcstats:
aliases: [/stats]
description: Shows your mcMMO stats and xp
mcremove:
aliases: []