Updated command manager

This commit is contained in:
Tim Visée 2015-11-01 16:36:05 +01:00
parent 59d02e1497
commit 756469449e

View File

@ -1,6 +1,6 @@
package fr.xephi.authme.command; package fr.xephi.authme.command;
import com.timvisee.dungeonmaze.command.executable.*; import fr.xephi.authme.command.executable.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -28,14 +28,13 @@ public class CommandManager {
@SuppressWarnings("SpellCheckingInspection") @SuppressWarnings("SpellCheckingInspection")
public void registerCommands() { public void registerCommands() {
// Register the base Dungeon Maze command // Register the base Dungeon Maze command
CommandDescription dungeonMazeCommand = new CommandDescription( CommandDescription authMeCommand = new CommandDescription(
new DungeonMazeCommand(), new AuthMeCommand(),
new ArrayList<String>() {{ new ArrayList<String>() {{
add("dungeonmaze"); add("authme");
add("dm");
}}, }},
"Main command", "Main command",
"The main Dungeon Maze command. The root for all the other commands.", null); "The main AuthMeReloaded command. The root for all the other commands.", null);
// Register the help command // Register the help command
CommandDescription helpCommand = new CommandDescription( CommandDescription helpCommand = new CommandDescription(
@ -48,12 +47,12 @@ public class CommandManager {
add("?"); add("?");
}}, }},
"View help", "View help",
"View detailed help pages about Dungeon Maze commands.", "View detailed help pages about AuthMeReloaded commands.",
dungeonMazeCommand); authMeCommand);
helpCommand.addArgument(new CommandArgumentDescription("query", "The command or query to view help for.", true)); helpCommand.addArgument(new CommandArgumentDescription("query", "The command or query to view help for.", true));
helpCommand.setMaximumArguments(false); helpCommand.setMaximumArguments(false);
// Register the create command /*// Register the create command
CommandDescription createWorldCommand = new CommandDescription( CommandDescription createWorldCommand = new CommandDescription(
new CreateWorldCommand(), new CreateWorldCommand(),
new ArrayList<String>() {{ new ArrayList<String>() {{
@ -236,10 +235,10 @@ public class CommandManager {
"Version info", "Version info",
"Show detailed information about the installed Dungeon Maze version, and shows the developers, contributors, license and other information.", "Show detailed information about the installed Dungeon Maze version, and shows the developers, contributors, license and other information.",
dungeonMazeCommand); dungeonMazeCommand);
versionCommand.setMaximumArguments(false); versionCommand.setMaximumArguments(false);*/
// Add the base command to the commands array // Add the base commands to the commands array
this.commandDescriptions.add(dungeonMazeCommand); this.commandDescriptions.add(authMeCommand);
} }
/** /**