#307 Finish changes to incomplete solution (f40d75e)

- Remove deprecated builder
- Fix introduced typos
This commit is contained in:
ljacqu 2015-12-08 21:51:33 +01:00
parent 330a275725
commit 595879b95e
2 changed files with 25 additions and 56 deletions

View File

@ -57,25 +57,6 @@ public class CommandDescription {
*/
private CommandPermissions permissions;
/**
* Constructor.
*
* @param executableCommand The executable command, or null.
* @param labels List of command labels.
* @param description Command description.
* @param detailedDescription Detailed comment description.
* @param parent Parent command.
*/
@Deprecated
public CommandDescription(ExecutableCommand executableCommand, List<String> labels, String description, String detailedDescription, CommandDescription parent) {
setExecutableCommand(executableCommand);
this.labels = labels;
this.description = description;
this.detailedDescription = detailedDescription;
setParent(parent);
this.arguments = new ArrayList<>();
}
/**
* Private constructor. Use {@link CommandDescription#builder()} to create instances of this class.
* <p />

View File

@ -184,7 +184,6 @@ public final class CommandInitializer {
.withArgument("player", "Player Name", false)
.build();
// Register the spawn command
CommandDescription.builder()
.executableCommand(new SpawnCommand())
@ -216,7 +215,6 @@ public final class CommandInitializer {
.permissions(OP_ONLY, AdminPermission.FIRST_SPAWN)
.build();
// Register the setfirstspawn command
CommandDescription.builder()
.executableCommand(new SetFirstSpawnCommand())
@ -242,7 +240,8 @@ public final class CommandInitializer {
CommandDescription.builder()
.executableCommand(new PurgeLastPositionCommand())
.parent(AUTHME_BASE)
.labels("resetpos", "purgelastposition", "purgelastpos", "resetposition", "resetlastposition", "resetlastpos")
.labels("resetpos", "purgelastposition", "purgelastpos", "resetposition",
"resetlastposition", "resetlastpos")
.description("Purge player's last position")
.detailedDescription("Purge the last know position of the specified player.")
.permissions(OP_ONLY, AdminPermission.PURGE_LAST_POSITION)
@ -250,7 +249,7 @@ public final class CommandInitializer {
.build();
// Register the purgebannedplayers command
CommandDescription purgeBannedPlayersCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new PurgeBannedPlayersCommand())
.parent(AUTHME_BASE)
.labels("purgebannedplayers", "purgebannedplayer", "deletebannedplayers", "deletebannedplayer")
@ -260,7 +259,7 @@ public final class CommandInitializer {
.build();
// Register the switchantibot command
CommandDescription switchAntiBotCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new SwitchAntiBotCommand())
.parent(AUTHME_BASE)
.labels("switchantibot", "toggleantibot", "antibot")
@ -270,26 +269,13 @@ public final class CommandInitializer {
.withArgument("mode", "ON / OFF", true)
.build();
// // Register the resetname command
// CommandDescription resetNameCommand = new CommandDescription(
// new ResetNameCommand(),
// new ArrayList<String>() {{
// add("resetname");
// add("resetnames");
// }},
// "Reset name",
// "Reset name",
// authMeCommand);
// resetNameCommand.setCommandPermissions("authme.admin.resetname",
// CommandPermissions.DefaultPermission.OP_ONLY);
// Register the reload command
CommandDescription reloadCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new ReloadCommand())
.parent(AUTHME_BASE)
.labels("reload", "rld")
.description("Reload plugin")
.detailedDescription("Reload the AutheMeReloaded plugin.")
.detailedDescription("Reload the AuthMeReloaded plugin.")
.permissions(OP_ONLY, AdminPermission.RELOAD)
.build();
@ -315,7 +301,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription loginHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(LOGIN_BASE)
.labels(helpCommandLabels)
@ -335,7 +321,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription logoutHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(LOGOUT_BASE)
.labels(helpCommandLabels)
@ -357,7 +343,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription registerHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(REGISTER_BASE)
.labels(helpCommandLabels)
@ -378,7 +364,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription unregisterHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(UNREGISTER_BASE)
.labels(helpCommandLabels)
@ -400,7 +386,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription changePasswordHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(CHANGE_PASSWORD_BASE)
.labels(helpCommandLabels)
@ -419,7 +405,7 @@ public final class CommandInitializer {
.build();
// Register the help command
CommandDescription emailHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(EMAIL_BASE)
.labels(helpCommandLabels)
@ -429,24 +415,24 @@ public final class CommandInitializer {
.build();
// Register the add command
CommandDescription addEmailCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new AddEmailCommand())
.parent(EMAIL_BASE)
.labels("add", "addemail", "addmail")
.description("Add Email")
.detailedDescription("Add a new Email address to your account.")
.detailedDescription("Add a new email address to your account.")
.permissions(ALLOWED, PlayerPermission.ADD_EMAIL)
.withArgument("email", "Email address", false)
.withArgument("verifyEmail", "Email address verification", false)
.build();
// Register the change command
CommandDescription changeEmailCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new ChangeEmailCommand())
.parent(EMAIL_BASE)
.labels("change", "changeemail", "changemail")
.description("Change Email")
.detailedDescription("Change an Email address of your account.")
.detailedDescription("Change an email address of your account.")
.permissions(ALLOWED, PlayerPermission.CHANGE_EMAIL)
.withArgument("oldEmail", "Old email address", false)
.withArgument("newEmail", "New email address", false)
@ -454,12 +440,13 @@ public final class CommandInitializer {
// Register the recover command
CommandDescription recoverEmailCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(new RecoverEmailCommand())
.parent(EMAIL_BASE)
.labels("recover", "recovery", "recoveremail", "recovermail")
.description("Recover password using Email")
.detailedDescription("Recover your account using an Email address by sending a mail containing a new password.")
.detailedDescription("Recover your account using an Email address by sending a mail containing " +
"a new password.")
.permissions(ALLOWED, PlayerPermission.RECOVER_EMAIL)
.withArgument("email", "Email address", false)
.build();
@ -470,13 +457,13 @@ public final class CommandInitializer {
.parent(null)
.labels("captcha", "capt")
.description("Captcha Command")
.detailedDescription("Captcha command for AuthMeRelaoded.")
.detailedDescription("Captcha command for AuthMeReloaded.")
.permissions(ALLOWED, PlayerPermission.CAPTCHA)
.withArgument("captcha", "The Captcha", false)
.build();
// Register the help command
CommandDescription captchaHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(CAPTCHA_BASE)
.labels(helpCommandLabels)
@ -491,13 +478,14 @@ public final class CommandInitializer {
.parent(null)
.labels("converter", "convert", "conv")
.description("Converter Command")
.detailedDescription("Converter command for AuthMeRelaoded.")
.detailedDescription("Converter command for AuthMeReloaded.")
.permissions(OP_ONLY, AdminPermission.CONVERTER)
.withArgument("job", "Conversion job: flattosql / flattosqlite /| xauth / crazylogin / rakamak / royalauth / vauth / sqltoflat", false)
.withArgument("job", "Conversion job: flattosql / flattosqlite /| xauth / crazylogin / rakamak / " +
"royalauth / vauth / sqltoflat", false)
.build();
// Register the help command
CommandDescription converterHelpCommand = CommandDescription.builder()
CommandDescription.builder()
.executableCommand(helpCommandExecutable)
.parent(CONVERTER_BASE)
.labels(helpCommandLabels)