Part of CommandBuilder rework 1/?

This commit is contained in:
Xephi 2015-12-05 19:16:16 +01:00
parent 1db24adb5d
commit 8460725c83

View File

@ -174,74 +174,80 @@ public final class CommandInitializer {
.build(); .build();
// Register the getip command // Register the getip command
CommandDescription getIpCommand = new CommandDescription(new GetIpCommand(), new ArrayList<String>() { CommandDescription getIpCommand = CommandDescription.builder()
{ .executableCommand(new GetIpCommand())
add("getip"); .parent(AUTHME_BASE)
add("ip"); .labels("getip", "ip")
} .description("Get player's IP")
}, "Get player's IP", "Get the IP address of the specified online player.", AUTHME_BASE); .detailedDescription("Get the IP address of the specified online player.")
getIpCommand.setCommandPermissions(AdminPermission.GET_IP, OP_ONLY); .permissions(OP_ONLY, AdminPermission.GET_IP, AdminPermission.ALL)
getIpCommand.addArgument(new CommandArgumentDescription("player", "Online player name", true)); .withArgument("player", "Player Name", false)
.build();
// Register the spawn command // Register the spawn command
CommandDescription spawnCommand = new CommandDescription(new SpawnCommand(), new ArrayList<String>() { CommandDescription spawnCommand = CommandDescription.builder()
{ .executableCommand(new SpawnCommand())
add("spawn"); .parent(AUTHME_BASE)
add("home"); .labels("spawn", "home")
} .description("Teleport to spawn")
}, "Teleport to spawn", "Teleport to the spawn.", AUTHME_BASE); .detailedDescription("Teleport to the spawn")
spawnCommand.setCommandPermissions(AdminPermission.SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SPAWN, AdminPermission.ALL)
.withArgument("player", "Player Name", false)
.build();
// Register the setspawn command // Register the setspawn command
CommandDescription setSpawnCommand = new CommandDescription(new SetSpawnCommand(), new ArrayList<String>() { CommandDescription setSpawnCommand = CommandDescription.builder()
{ .executableCommand(new SetSpawnCommand())
add("setspawn"); .parent(AUTHME_BASE)
add("chgspawn"); .labels("setspawn", "chgspawn")
} .description("Change the spawn")
}, "Change the spawn", "Change the player's spawn to your current position.", AUTHME_BASE); .detailedDescription("Change the player's spawn to your current position.")
setSpawnCommand.setCommandPermissions(AdminPermission.SET_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SET_SPAWN, AdminPermission.ALL)
.build();
// Register the firstspawn command // Register the firstspawn command
CommandDescription firstSpawnCommand = new CommandDescription(new FirstSpawnCommand(), new ArrayList<String>() { CommandDescription firstSpawnCommand = CommandDescription.builder()
{ .executableCommand(new FirstSpawnCommand())
add("firstspawn"); .parent(AUTHME_BASE)
add("firsthome"); .labels("firstspawn", "firsthome")
} .description("Teleport to first spawn")
}, "Teleport to first spawn", "Teleport to the first spawn.", AUTHME_BASE); .detailedDescription("Teleport to the first spawn.")
firstSpawnCommand.setCommandPermissions(AdminPermission.FIRST_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.FIRST_SPAWN, AdminPermission.ALL)
.build();
// Register the setfirstspawn command // Register the setfirstspawn command
CommandDescription setFirstSpawnCommand = new CommandDescription(new SetFirstSpawnCommand(), new ArrayList<String>() { CommandDescription setFirstSpawnCommand = CommandDescription.builder()
{ .executableCommand(new SetFirstSpawnCommand())
add("setfirstspawn"); .parent(AUTHME_BASE)
add("chgfirstspawn"); .labels("setfirstspawn", "chgfirstspawn")
} .description("Change the first spawn")
}, "Change the first spawn", "Change the first player's spawn to your current position.", AUTHME_BASE); .detailedDescription("Change the first player's spawn to your current position.")
setFirstSpawnCommand.setCommandPermissions(AdminPermission.SET_FIRST_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SET_FIRST_SPAWN, AdminPermission.ALL)
.build();
// Register the purge command // Register the purge command
CommandDescription purgeCommand = new CommandDescription(new PurgeCommand(), new ArrayList<String>() { CommandDescription purgeCommand = CommandDescription.builder()
{ .executableCommand(new PurgeCommand())
add("purge"); .parent(AUTHME_BASE)
add("delete"); .labels("purge", "delete")
} .description("Purge old data")
}, "Purge old data", "Purge old AuthMeReloaded data longer than the specified amount of days ago.", AUTHME_BASE); .detailedDescription("Purge old AuthMeReloaded data longer than the specified amount of days ago.")
purgeCommand.setCommandPermissions(AdminPermission.PURGE, OP_ONLY); .permissions(OP_ONLY, AdminPermission.PURGE, AdminPermission.ALL)
purgeCommand.addArgument(new CommandArgumentDescription("days", "Number of days", false)); .withArgument("days", "Number of days", false)
.build();
// Register the purgelastposition command // Register the purgelastposition command
CommandDescription purgeLastPositionCommand = new CommandDescription(new PurgeLastPositionCommand(), new ArrayList<String>() { CommandDescription purgeLastPositionCommand = CommandDescription.builder()
{ .executableCommand(new PurgeLastPositionCommand())
add("resetpos"); .parent(AUTHME_BASE)
add("purgelastposition"); .labels("resetpos", "purgelastposition", "purgelastpos", "resetposition", "resetlastposition", "resetlastpos")
add("purgelastpos"); .description("Purge player's last position")
add("resetposition"); .detailedDescription("Purge the last know position of the specified player.")
add("resetlastposition"); .permissions(OP_ONLY, AdminPermission.PURGE_LAST_POSITION, AdminPermission.ALL)
add("resetlastpos"); .withArgument("player", "Player name", false)
} .build();
}, "Purge player's last position", "Purge the last know position of the specified player.", AUTHME_BASE);
purgeLastPositionCommand.setCommandPermissions(AdminPermission.PURGE_LAST_POSITION, OP_ONLY);
purgeLastPositionCommand.addArgument(new CommandArgumentDescription("player", "Player name", true));
// Register the purgebannedplayers command // Register the purgebannedplayers command
CommandDescription purgeBannedPlayersCommand = new CommandDescription(new PurgeBannedPlayersCommand(), new ArrayList<String>() { CommandDescription purgeBannedPlayersCommand = new CommandDescription(new PurgeBannedPlayersCommand(), new ArrayList<String>() {