Java Code Examples for org.spongepowered.api.command.spec.CommandSpec#Builder
The following examples show how to use
org.spongepowered.api.command.spec.CommandSpec#Builder .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NationadminExtraspawnplayerExecutor.java From Nations with MIT License | 6 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.extraspawnplayer") .arguments( GenericArguments.optional(GenericArguments.choices(Text.of("give|take|set"), ImmutableMap.<String, String> builder() .put("give", "give") .put("take", "take") .put("set", "set") .build())), GenericArguments.optional(new PlayerNameElement(Text.of("player"))), GenericArguments.optional(GenericArguments.integer(Text.of("amount")))) .executor(new NationadminExtraspawnplayerExecutor()) .build(), "extraspawnplayer"); }
Example 2
Source File: NationadminPermExecutor.java From Nations with MIT License | 6 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.perm") .arguments( GenericArguments.optional(new NationNameElement(Text.of("nation"))), GenericArguments.optional(GenericArguments.choices(Text.of("type"), ImmutableMap.<String, String> builder() .put(Nation.TYPE_OUTSIDER, Nation.TYPE_OUTSIDER) .put(Nation.TYPE_CITIZEN, Nation.TYPE_CITIZEN) .put(Nation.TYPE_COOWNER, Nation.TYPE_COOWNER) .build())), GenericArguments.optional(GenericArguments.choices(Text.of("perm"), ImmutableMap.<String, String> builder() .put(Nation.PERM_BUILD, Nation.PERM_BUILD) .put(Nation.PERM_INTERACT, Nation.PERM_INTERACT) .build())), GenericArguments.optional(GenericArguments.bool(Text.of("bool")))) .executor(new NationadminPermExecutor()) .build(), "perm"); }
Example 3
Source File: NationClaimExecutor.java From Nations with MIT License | 6 votes |
public static void create(CommandSpec.Builder cmd) { CommandSpec subCmd = CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.claim.outpost") .arguments() .executor(new NationClaimOutpostExecutor()) .build(); cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.claim") .arguments() .executor(new NationClaimExecutor()) .child(subCmd, "outpost", "o") .build(), "claim"); }
Example 4
Source File: ZonePermExecutor.java From Nations with MIT License | 6 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.zone.perm") .arguments( GenericArguments.choices(Text.of("type"), ImmutableMap.<String, String> builder() .put(Nation.TYPE_OUTSIDER, Nation.TYPE_OUTSIDER) .put(Nation.TYPE_CITIZEN, Nation.TYPE_CITIZEN) .put(Nation.TYPE_COOWNER, Nation.TYPE_COOWNER) .build()), GenericArguments.choices(Text.of("perm"), ImmutableMap.<String, String> builder() .put(Nation.PERM_BUILD, Nation.PERM_BUILD) .put(Nation.PERM_INTERACT, Nation.PERM_INTERACT) .build()), GenericArguments.optional(GenericArguments.bool(Text.of("bool")))) .executor(new ZonePermExecutor()) .build(), "perm"); }
Example 5
Source File: NationadminEcoExecutor.java From Nations with MIT License | 6 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.eco") .arguments( GenericArguments.optional(GenericArguments.choices(Text.of("give|take|set"), ImmutableMap.<String, String> builder() .put("give", "give") .put("take", "take") .put("set", "set") .build())), GenericArguments.optional(new NationNameElement(Text.of("nation"))), GenericArguments.optional(GenericArguments.doubleNum(Text.of("amount")))) .executor(new NationadminEcoExecutor()) .build(), "eco"); }
Example 6
Source File: NationHereExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.here") .arguments() .executor(new NationHereExecutor()) .build(), "here", "h"); }
Example 7
Source File: NationCitizenExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.citizen") .arguments(GenericArguments.optional(new PlayerNameElement(Text.of("player")))) .executor(new NationCitizenExecutor()) .build(), "citizen", "whois"); }
Example 8
Source File: NationJoinExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.join") .arguments(GenericArguments.optional(new NationNameElement(Text.of("nation")))) .executor(new NationJoinExecutor()) .build(), "join", "apply"); }
Example 9
Source File: NationDelspawnExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.delspawn") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("name")))) .executor(new NationDelspawnExecutor()) .build(), "delspawn"); }
Example 10
Source File: NationListExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.list") .arguments() .executor(new NationListExecutor()) .build(), "list", "l"); }
Example 11
Source File: NationSetspawnExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.setspawn") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("name")))) .executor(new NationSetspawnExecutor()) .build(), "setspawn"); }
Example 12
Source File: NationKickExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.kick") .arguments(GenericArguments.optional(new CitizenNameElement(Text.of("player")))) .executor(new NationKickExecutor()) .build(), "kick"); }
Example 13
Source File: NationCreateExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.create") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("name")))) .executor(new NationCreateExecutor()) .build(), "create", "new"); }
Example 14
Source File: NationadminUnclaimExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.unclaim") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("nation")))) .executor(new NationadminUnclaimExecutor()) .build(), "unclaim"); }
Example 15
Source File: NationadminForcejoinExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.forcejoin") .arguments( GenericArguments.optional(new NationNameElement(Text.of("nation"))), GenericArguments.optional(new PlayerNameElement(Text.of("player")))) .executor(new NationadminForcejoinExecutor()) .build(), "forcejoin"); }
Example 16
Source File: ZoneSetownerExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.zone.setowner") .arguments(GenericArguments.optional(new PlayerNameElement(Text.of("owner")))) .executor(new ZoneSetownerExecutor()) .build(), "setowner"); }
Example 17
Source File: NationSpawnExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nation.spawn") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("name")))) .executor(new NationSpawnExecutor()) .build(), "spawn"); }
Example 18
Source File: ZoneCoownerExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.zone.coowner") .arguments( GenericArguments.optional(GenericArguments.choices(Text.of("add|remove"), ImmutableMap.<String, String> builder() .put("add", "add") .put("remove", "remove") .build())), GenericArguments.optional(new PlayerNameElement(Text.of("citizen")))) .executor(new ZoneCoownerExecutor()) .build(), "coowner"); }
Example 19
Source File: NationadminCreateExecutor.java From Nations with MIT License | 5 votes |
public static void create(CommandSpec.Builder cmd) { cmd.child(CommandSpec.builder() .description(Text.of("")) .permission("nations.command.nationadmin.create") .arguments(GenericArguments.optional(GenericArguments.string(Text.of("name")))) .executor(new NationadminCreateExecutor()) .build(), "create"); }
Example 20
Source File: NationClaimOutpostExecutor.java From Nations with MIT License | 4 votes |
public static void create(CommandSpec.Builder cmd) { // subcommand of NationClaimOutpost }