2013-03-01 06:52:01 +01:00
|
|
|
package com.gmail.nossr50.util.commands;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.bukkit.command.PluginCommand;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.mcMMO;
|
2013-05-03 22:14:03 +02:00
|
|
|
import com.gmail.nossr50.commands.KrakenCommand;
|
2014-07-20 22:40:59 +02:00
|
|
|
import com.gmail.nossr50.commands.McImportCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.McabilityCommand;
|
2013-10-29 20:38:20 +01:00
|
|
|
import com.gmail.nossr50.commands.McconvertCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.McgodCommand;
|
|
|
|
import com.gmail.nossr50.commands.McmmoCommand;
|
|
|
|
import com.gmail.nossr50.commands.McnotifyCommand;
|
|
|
|
import com.gmail.nossr50.commands.McrefreshCommand;
|
2013-04-30 15:48:53 +02:00
|
|
|
import com.gmail.nossr50.commands.McscoreboardCommand;
|
2013-04-05 04:11:11 +02:00
|
|
|
import com.gmail.nossr50.commands.MobhealthCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.XprateCommand;
|
|
|
|
import com.gmail.nossr50.commands.chat.AdminChatCommand;
|
|
|
|
import com.gmail.nossr50.commands.chat.PartyChatCommand;
|
|
|
|
import com.gmail.nossr50.commands.database.McpurgeCommand;
|
|
|
|
import com.gmail.nossr50.commands.database.McremoveCommand;
|
2013-06-29 00:02:58 +02:00
|
|
|
import com.gmail.nossr50.commands.database.MmoshowdbCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.experience.AddlevelsCommand;
|
|
|
|
import com.gmail.nossr50.commands.experience.AddxpCommand;
|
|
|
|
import com.gmail.nossr50.commands.experience.MmoeditCommand;
|
|
|
|
import com.gmail.nossr50.commands.experience.SkillresetCommand;
|
|
|
|
import com.gmail.nossr50.commands.hardcore.HardcoreCommand;
|
|
|
|
import com.gmail.nossr50.commands.hardcore.VampirismCommand;
|
|
|
|
import com.gmail.nossr50.commands.party.PartyCommand;
|
2013-03-12 21:25:42 +01:00
|
|
|
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.player.InspectCommand;
|
2013-09-12 04:42:27 +02:00
|
|
|
import com.gmail.nossr50.commands.player.MccooldownCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.player.McrankCommand;
|
|
|
|
import com.gmail.nossr50.commands.player.McstatsCommand;
|
|
|
|
import com.gmail.nossr50.commands.player.MctopCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.AcrobaticsCommand;
|
2013-11-16 00:21:00 +01:00
|
|
|
import com.gmail.nossr50.commands.skills.AlchemyCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.skills.ArcheryCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.AxesCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.ExcavationCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.FishingCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.HerbalismCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.MiningCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.RepairCommand;
|
2013-03-06 18:31:48 +01:00
|
|
|
import com.gmail.nossr50.commands.skills.SalvageCommand;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.commands.skills.SmeltingCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.SwordsCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.TamingCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.UnarmedCommand;
|
|
|
|
import com.gmail.nossr50.commands.skills.WoodcuttingCommand;
|
|
|
|
import com.gmail.nossr50.config.Config;
|
|
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
|
|
import com.gmail.nossr50.util.StringUtils;
|
|
|
|
|
|
|
|
public final class CommandRegistrationManager {
|
|
|
|
private CommandRegistrationManager() {};
|
|
|
|
|
|
|
|
private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission");
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerSkillCommands() {
|
2013-03-01 06:52:01 +01:00
|
|
|
for (SkillType skill : SkillType.values()) {
|
|
|
|
String commandName = skill.toString().toLowerCase();
|
2013-10-28 18:04:06 +01:00
|
|
|
String localizedName = skill.getName().toLowerCase();
|
2013-03-01 06:52:01 +01:00
|
|
|
|
|
|
|
PluginCommand command;
|
|
|
|
|
|
|
|
command = mcMMO.p.getCommand(commandName);
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.Skill", StringUtils.getCapitalized(localizedName)));
|
|
|
|
command.setPermission("mcmmo.commands." + commandName);
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", localizedName));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.2", localizedName, "?", "[" + LocaleLoader.getString("Commands.Usage.Page") + "]"));
|
|
|
|
|
|
|
|
switch (skill) {
|
|
|
|
case ACROBATICS:
|
|
|
|
command.setExecutor(new AcrobaticsCommand());
|
|
|
|
break;
|
|
|
|
|
2013-11-16 00:21:00 +01:00
|
|
|
case ALCHEMY:
|
|
|
|
command.setExecutor(new AlchemyCommand());
|
|
|
|
break;
|
|
|
|
|
2013-03-01 06:52:01 +01:00
|
|
|
case ARCHERY:
|
|
|
|
command.setExecutor(new ArcheryCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AXES:
|
|
|
|
command.setExecutor(new AxesCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EXCAVATION:
|
|
|
|
command.setExecutor(new ExcavationCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FISHING:
|
|
|
|
command.setExecutor(new FishingCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HERBALISM:
|
|
|
|
command.setExecutor(new HerbalismCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MINING:
|
|
|
|
command.setExecutor(new MiningCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REPAIR:
|
|
|
|
command.setExecutor(new RepairCommand());
|
|
|
|
break;
|
|
|
|
|
2013-03-06 18:31:48 +01:00
|
|
|
case SALVAGE:
|
|
|
|
command.setExecutor(new SalvageCommand());
|
|
|
|
break;
|
|
|
|
|
2013-03-01 06:52:01 +01:00
|
|
|
case SMELTING:
|
|
|
|
command.setExecutor(new SmeltingCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SWORDS:
|
|
|
|
command.setExecutor(new SwordsCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TAMING:
|
|
|
|
command.setExecutor(new TamingCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case UNARMED:
|
|
|
|
command.setExecutor(new UnarmedCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WOODCUTTING:
|
|
|
|
command.setExecutor(new WoodcuttingCommand());
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerAddlevelsCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("addlevels");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.addlevels"));
|
|
|
|
command.setPermission("mcmmo.commands.addlevels;mcmmo.commands.addlevels.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.3", "addlevels", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">"));
|
|
|
|
command.setExecutor(new AddlevelsCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerAddxpCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("addxp");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.addxp"));
|
|
|
|
command.setPermission("mcmmo.commands.addxp;mcmmo.commands.addxp.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.3", "addxp", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.XP") + ">"));
|
|
|
|
command.setExecutor(new AddxpCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcgodCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcgod");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcgod"));
|
|
|
|
command.setPermission("mcmmo.commands.mcgod;mcmmo.commands.mcgod.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcgod", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
|
|
|
command.setExecutor(new McgodCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcrefreshCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcrefresh");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcrefresh"));
|
|
|
|
command.setPermission("mcmmo.commands.mcrefresh;mcmmo.commands.mcrefresh.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcrefresh", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
|
|
|
command.setExecutor(new McrefreshCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMmoeditCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mmoedit");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mmoedit"));
|
|
|
|
command.setPermission("mcmmo.commands.mmoedit;mcmmo.commands.mmoedit.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.3", "mmoedit", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">"));
|
|
|
|
command.setExecutor(new MmoeditCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerSkillresetCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("skillreset");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.skillreset"));
|
|
|
|
command.setPermission("mcmmo.commands.skillreset;mcmmo.commands.skillreset.others"); // Only need the main ones, not the individual skill ones
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.2", "skillreset", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">"));
|
|
|
|
command.setExecutor(new SkillresetCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerXprateCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
List<String> aliasList = new ArrayList<String>();
|
|
|
|
aliasList.add("mcxprate");
|
|
|
|
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("xprate");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.xprate"));
|
|
|
|
command.setPermission("mcmmo.commands.xprate;mcmmo.commands.xprate.reset;mcmmo.commands.xprate.set");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.2", "xprate", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">", "<true|false>"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "xprate", "reset"));
|
|
|
|
command.setAliases(aliasList);
|
|
|
|
command.setExecutor(new XprateCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerInspectCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("inspect");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.inspect"));
|
|
|
|
command.setPermission("mcmmo.commands.inspect;mcmmo.commands.inspect.far;mcmmo.commands.inspect.offline");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "inspect", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
|
|
|
|
command.setExecutor(new InspectCommand());
|
|
|
|
}
|
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
private static void registerMccooldownCommand() {
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("mccooldown");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mccooldown"));
|
|
|
|
command.setPermission("mcmmo.commands.mccooldown");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mccooldowns"));
|
|
|
|
command.setExecutor(new MccooldownCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcabilityCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcability");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcability"));
|
|
|
|
command.setPermission("mcmmo.commands.mcability;mcmmo.commands.mcability.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcability", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
|
|
|
command.setExecutor(new McabilityCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcmmoCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcmmo");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcmmo"));
|
|
|
|
command.setPermission("mcmmo.commands.mcmmo.description;mcmmo.commands.mcmmo.help");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcmmo"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "mcmmo", "help"));
|
|
|
|
command.setExecutor(new McmmoCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcrankCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcrank");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcrank"));
|
|
|
|
command.setPermission("mcmmo.commands.mcrank;mcmmo.commands.mcrank.others;mcmmo.commands.mcrank.others.far;mcmmo.commands.mcrank.others.offline");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcrank", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
|
|
|
command.setExecutor(new McrankCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcstatsCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMctopCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mctop");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mctop"));
|
|
|
|
command.setPermission("mcmmo.commands.mctop"); // Only need the main one, not the individual skill ones
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.2", "mctop", "[" + LocaleLoader.getString("Commands.Usage.Skill") + "]", "[" + LocaleLoader.getString("Commands.Usage.Page") + "]"));
|
|
|
|
command.setExecutor(new MctopCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcpurgeCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcpurge");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcpurge", Config.getInstance().getOldUsersCutoff()));
|
2013-05-01 14:40:01 +02:00
|
|
|
command.setPermission("mcmmo.commands.mcpurge");
|
2013-03-01 06:52:01 +01:00
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcpurge"));
|
|
|
|
command.setExecutor(new McpurgeCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcremoveCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcremove");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcremove"));
|
2013-05-01 14:40:01 +02:00
|
|
|
command.setPermission("mcmmo.commands.mcremove");
|
2013-03-01 06:52:01 +01:00
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcremove", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
|
|
|
|
command.setExecutor(new McremoveCommand());
|
|
|
|
}
|
|
|
|
|
2013-06-29 00:02:58 +02:00
|
|
|
private static void registerMmoshowdbCommand() {
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("mmoshowdb");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mmoshowdb"));
|
|
|
|
command.setPermission("mcmmo.commands.mmoshowdb");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mmoshowdb"));
|
|
|
|
command.setExecutor(new MmoshowdbCommand());
|
|
|
|
}
|
|
|
|
|
2013-05-20 15:38:30 +02:00
|
|
|
private static void registerMcconvertCommand() {
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcconvert");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcconvert"));
|
2013-08-22 15:11:33 +02:00
|
|
|
command.setPermission("mcmmo.commands.mcconvert;mcmmo.commands.mcconvert.experience;mcmmo.commands.mcconvert.database");
|
2013-05-20 15:38:30 +02:00
|
|
|
command.setPermissionMessage(permissionsMessage);
|
2013-09-10 21:47:15 +02:00
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.2", "mcconvert", "database", "<flatfile|sql>"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.2", "mcconvert", "experience", "<linear|exponential>"));
|
2013-05-20 15:38:30 +02:00
|
|
|
command.setExecutor(new McconvertCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerAdminChatCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("adminchat");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.adminchat"));
|
|
|
|
command.setPermission("mcmmo.chat.adminchat");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "adminchat"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "adminchat", "<on|off>"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "adminchat", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"));
|
|
|
|
command.setExecutor(new AdminChatCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerPartyChatCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("partychat");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.partychat"));
|
|
|
|
command.setPermission("mcmmo.chat.partychat;mcmmo.commands.party");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "partychat"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "partychat", "<on|off>"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "partychat", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"));
|
|
|
|
command.setExecutor(new PartyChatCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerPartyCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
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;" +
|
2013-11-11 17:42:57 +01:00
|
|
|
"mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" +
|
2013-03-01 06:52:01 +01:00
|
|
|
"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());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerPtpCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("ptp");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.ptp"));
|
2013-03-03 05:53:25 +01:00
|
|
|
command.setPermission("mcmmo.commands.ptp"); // Only need the main one, not the individual ones for toggle/accept/acceptall
|
2013-03-01 06:52:01 +01:00
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "ptp", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "ptp", "<toggle|accept|acceptall>"));
|
|
|
|
command.setExecutor(new PtpCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerHardcoreCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("hardcore");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.hardcore"));
|
|
|
|
command.setPermission("mcmmo.commands.hardcore;mcmmo.commands.hardcore.toggle;mcmmo.commands.hardcore.modify");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "hardcore", "[on|off]"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "hardcore", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
|
|
|
command.setExecutor(new HardcoreCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerVampirismCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("vampirism");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.vampirism"));
|
|
|
|
command.setPermission("mcmmo.commands.vampirism;mcmmo.commands.vampirism.toggle;mcmmo.commands.vampirism.modify");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "vampirism", "[on|off]"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "vampirism", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
|
|
|
command.setExecutor(new VampirismCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcnotifyCommand() {
|
2013-03-01 06:52:01 +01:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcnotify");
|
|
|
|
command.setDescription(LocaleLoader.getString("Commands.Description.mcnotify"));
|
|
|
|
command.setPermission("mcmmo.commands.mcnotify");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcnotify"));
|
|
|
|
command.setExecutor(new McnotifyCommand());
|
|
|
|
}
|
2013-04-05 04:11:11 +02:00
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMobhealthCommand() {
|
2013-04-05 04:11:11 +02:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mobhealth");
|
|
|
|
command.setDescription("Change the style of the mob healthbar"); //TODO: Localize
|
|
|
|
command.setPermission("mcmmo.commands.mobhealth");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mobhealth", "<DISABLED | HEARTS | BAR>"));
|
|
|
|
command.setExecutor(new MobhealthCommand());
|
|
|
|
}
|
2013-04-30 15:48:53 +02:00
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
private static void registerMcscoreboardCommand() {
|
2013-04-30 15:48:53 +02:00
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcscoreboard");
|
|
|
|
command.setDescription("Change the current mcMMO scoreboard being displayed"); //TODO: Localize
|
|
|
|
command.setPermission("mcmmo.commands.mcscoreboard");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
2013-10-28 18:04:06 +01:00
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcscoreboard", "<CLEAR | KEEP>"));
|
|
|
|
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.2", "mcscoreboard", "time", "<seconds>"));
|
2013-04-30 15:48:53 +02:00
|
|
|
command.setExecutor(new McscoreboardCommand());
|
|
|
|
}
|
2013-04-30 21:07:29 +02:00
|
|
|
|
2013-05-03 22:14:03 +02:00
|
|
|
private static void registerKrakenCommand() {
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("kraken");
|
|
|
|
command.setDescription("Unleash the kraken!"); //TODO: Localize
|
|
|
|
command.setPermission("mcmmo.commands.kraken;mcmmo.commands.kraken.others");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "kraken", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
|
|
|
command.setExecutor(new KrakenCommand());
|
|
|
|
}
|
|
|
|
|
2014-07-20 22:40:59 +02:00
|
|
|
private static void registerMcImportCommand() {
|
|
|
|
PluginCommand command = mcMMO.p.getCommand("mcimport");
|
|
|
|
command.setDescription("Import mod config files"); //TODO: Localize
|
|
|
|
command.setPermission("mcmmo.commands.mcimport");
|
|
|
|
command.setPermissionMessage(permissionsMessage);
|
|
|
|
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcimport"));
|
|
|
|
command.setExecutor(new McImportCommand());
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:07:29 +02:00
|
|
|
public static void registerCommands() {
|
|
|
|
// Generic Commands
|
2014-07-20 22:40:59 +02:00
|
|
|
registerMcImportCommand();
|
2013-05-03 22:14:03 +02:00
|
|
|
registerKrakenCommand();
|
2013-04-30 21:07:29 +02:00
|
|
|
registerMcabilityCommand();
|
|
|
|
registerMcgodCommand();
|
|
|
|
registerMcmmoCommand();
|
|
|
|
registerMcnotifyCommand();
|
|
|
|
registerMcrefreshCommand();
|
|
|
|
registerMcscoreboardCommand();
|
|
|
|
registerMobhealthCommand();
|
|
|
|
registerXprateCommand();
|
|
|
|
|
|
|
|
// Chat Commands
|
|
|
|
registerPartyChatCommand();
|
|
|
|
registerAdminChatCommand();
|
|
|
|
|
|
|
|
// Database Commands
|
|
|
|
registerMcpurgeCommand();
|
|
|
|
registerMcremoveCommand();
|
2013-06-29 00:02:58 +02:00
|
|
|
registerMmoshowdbCommand();
|
2013-05-20 15:38:30 +02:00
|
|
|
registerMcconvertCommand();
|
2013-04-30 21:07:29 +02:00
|
|
|
|
|
|
|
// Experience Commands
|
|
|
|
registerAddlevelsCommand();
|
|
|
|
registerAddxpCommand();
|
|
|
|
registerMmoeditCommand();
|
|
|
|
registerSkillresetCommand();
|
|
|
|
|
|
|
|
// Hardcore Commands
|
|
|
|
registerHardcoreCommand();
|
|
|
|
registerVampirismCommand();
|
|
|
|
|
|
|
|
// Party Commands
|
|
|
|
registerPartyCommand();
|
|
|
|
registerPtpCommand();
|
|
|
|
|
|
|
|
// Player Commands
|
|
|
|
registerInspectCommand();
|
2013-09-12 04:42:27 +02:00
|
|
|
registerMccooldownCommand();
|
2013-04-30 21:07:29 +02:00
|
|
|
registerMcrankCommand();
|
|
|
|
registerMcstatsCommand();
|
|
|
|
registerMctopCommand();
|
|
|
|
|
|
|
|
// Skill Commands
|
|
|
|
registerSkillCommands();
|
|
|
|
}
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|