mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 07:07:55 +01:00
Converted two commands to use the builder
This commit is contained in:
parent
999c08956d
commit
4afef9714d
@ -135,29 +135,27 @@ public class CommandManager {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Register the getemail command
|
// Register the getemail command
|
||||||
CommandDescription getEmailCommand = new CommandDescription(new GetEmailCommand(), new ArrayList<String>() {
|
CommandDescription getEmailCommand = CommandDescription.builder()
|
||||||
{
|
.executableCommand(new GetEmailCommand())
|
||||||
add("getemail");
|
.labels("getemail", "getmail", "email", "mail")
|
||||||
add("getmail");
|
.description("Display player's email")
|
||||||
add("email");
|
.detailedDescription("Display the email address of the specified player if set.")
|
||||||
add("mail");
|
.parent(authMeBaseCommand)
|
||||||
}
|
.permissions(OP_ONLY, AdminPermission.GET_EMAIL)
|
||||||
}, "Display player's email", "Display the email address of the specified player if set.", authMeBaseCommand);
|
.withArgument("player", "Player name", true)
|
||||||
getEmailCommand.setCommandPermissions(AdminPermission.GET_EMAIL, OP_ONLY);
|
.build();
|
||||||
getEmailCommand.addArgument(new CommandArgumentDescription("player", "Player name", true));
|
|
||||||
|
|
||||||
// Register the setemail command
|
// Register the setemail command
|
||||||
CommandDescription setEmailCommand = new CommandDescription(new SetEmailCommand(), new ArrayList<String>() {
|
CommandDescription setEmailCommand = CommandDescription.builder()
|
||||||
{
|
.executableCommand(new SetEmailCommand())
|
||||||
add("chgemail");
|
.labels("chgemail", "chgmail", "setemail", "setmail")
|
||||||
add("chgmail");
|
.description("Change player's email")
|
||||||
add("setemail");
|
.detailedDescription("Change the email address of the specified player.")
|
||||||
add("setmail");
|
.parent(authMeBaseCommand)
|
||||||
}
|
.permissions(OP_ONLY, AdminPermission.CHANGE_EMAIL)
|
||||||
}, "Change player's email", "Change the email address of the specified player.", authMeBaseCommand);
|
.withArgument("player", "Player name", false)
|
||||||
setEmailCommand.setCommandPermissions(AdminPermission.CHANGE_EMAIL, OP_ONLY);
|
.withArgument("email", "Player email", false)
|
||||||
setEmailCommand.addArgument(new CommandArgumentDescription("player", "Player name", false));
|
.build();
|
||||||
setEmailCommand.addArgument(new CommandArgumentDescription("email", "Player email", false));
|
|
||||||
|
|
||||||
// Register the getip command
|
// Register the getip command
|
||||||
CommandDescription getIpCommand = new CommandDescription(new GetIpCommand(), new ArrayList<String>() {
|
CommandDescription getIpCommand = new CommandDescription(new GetIpCommand(), new ArrayList<String>() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package fr.xephi.authme.permission;
|
package fr.xephi.authme.permission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AuthMe admin permissions.
|
* AuthMe admin command permissions.
|
||||||
*/
|
*/
|
||||||
public enum AdminPermission implements PermissionNode {
|
public enum AdminPermission implements PermissionNode {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package fr.xephi.authme.permission;
|
package fr.xephi.authme.permission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AuthMe player permission nodes, for regular players.
|
* AuthMe player command permission nodes, for regular players.
|
||||||
*/
|
*/
|
||||||
public enum PlayerPermission implements PermissionNode {
|
public enum PlayerPermission implements PermissionNode {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user