Update /party to use Bukkit CommandAPI for permissions & description -

usage is handled internally due to the number of subcommands.
This commit is contained in:
GJ 2013-02-07 23:05:59 -05:00
parent 291393d45d
commit 3da062c4cc
4 changed files with 14 additions and 3 deletions

View File

@ -26,6 +26,7 @@ import com.gmail.nossr50.database.commands.McpurgeCommand;
import com.gmail.nossr50.database.commands.McremoveCommand; import com.gmail.nossr50.database.commands.McremoveCommand;
import com.gmail.nossr50.database.commands.MmoupdateCommand; import com.gmail.nossr50.database.commands.MmoupdateCommand;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.commands.PartyCommand;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsCommand; import com.gmail.nossr50.skills.acrobatics.AcrobaticsCommand;
import com.gmail.nossr50.skills.archery.ArcheryCommand; import com.gmail.nossr50.skills.archery.ArcheryCommand;
import com.gmail.nossr50.skills.axes.AxesCommand; import com.gmail.nossr50.skills.axes.AxesCommand;
@ -312,4 +313,15 @@ public final class CommandRegistrationHelper {
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "xplock", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">")); command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "xplock", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">"));
command.setExecutor(new XplockCommand()); command.setExecutor(new XplockCommand());
} }
public static void registerPartyCommand() {
PluginCommand command = mcMMO.p.getCommand("party");
command.setDescription(LocaleLoader.getString("Commands.Description.party"));
command.setPermission("mcmmo.commands.party;mcmmo.commands.party.accept;mcmmo.commands.party.create;mcmmo.commands.party.disband;" +
"mcmmo.commands.party.expshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" +
"mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" +
"mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock");
command.setPermissionMessage(permissionsMessage);
command.setExecutor(new PartyCommand());
}
} }

View File

@ -44,7 +44,6 @@ import com.gmail.nossr50.mods.config.CustomBlocksConfig;
import com.gmail.nossr50.mods.config.CustomEntityConfig; import com.gmail.nossr50.mods.config.CustomEntityConfig;
import com.gmail.nossr50.mods.config.CustomToolsConfig; import com.gmail.nossr50.mods.config.CustomToolsConfig;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.party.commands.PartyCommand;
import com.gmail.nossr50.party.commands.PtpCommand; import com.gmail.nossr50.party.commands.PtpCommand;
import com.gmail.nossr50.runnables.MobStoreCleaner; import com.gmail.nossr50.runnables.MobStoreCleaner;
import com.gmail.nossr50.runnables.SaveTimer; import com.gmail.nossr50.runnables.SaveTimer;
@ -287,7 +286,7 @@ public class mcMMO extends JavaPlugin {
// Party commands // Party commands
CommandRegistrationHelper.registerAdminChatCommand(); CommandRegistrationHelper.registerAdminChatCommand();
getCommand("party").setExecutor(new PartyCommand()); CommandRegistrationHelper.registerPartyCommand();
CommandRegistrationHelper.registerPartyChatCommand(); CommandRegistrationHelper.registerPartyChatCommand();
getCommand("ptp").setExecutor(new PtpCommand(this)); getCommand("ptp").setExecutor(new PtpCommand(this));

View File

@ -704,6 +704,7 @@ Commands.Description.mcstats=Show your mcMMO levels and XP
Commands.Description.mctop=Show mcMMO leader boards Commands.Description.mctop=Show mcMMO leader boards
Commands.Description.mmoedit=Edit mcMMO levels for a user Commands.Description.mmoedit=Edit mcMMO levels for a user
Commands.Description.mmoupdate=Convert mcMMO database from Flatfile to MySQL Commands.Description.mmoupdate=Convert mcMMO database from Flatfile to MySQL
Commands.Description.party=Control various mcMMO party settings
Commands.Description.partychat=Toggle mcMMO party chat on/off or send party chat messages Commands.Description.partychat=Toggle mcMMO party chat on/off or send party chat messages
Commands.Description.Skill=Display detailed mcMMO skill info for {0} Commands.Description.Skill=Display detailed mcMMO skill info for {0}
Commands.Description.skillreset=Reset mcMMO levels for a user Commands.Description.skillreset=Reset mcMMO levels for a user

View File

@ -58,7 +58,6 @@ commands:
aliases: [] aliases: []
description: Teleport to a party member description: Teleport to a party member
party: party:
aliases: []
description: Create/join a party description: Create/join a party
inspect: inspect:
description: View detailed mcMMO info on another player description: View detailed mcMMO info on another player