Class NationCommand

java.lang.Object
com.palmergames.bukkit.towny.command.BaseCommand
com.palmergames.bukkit.towny.command.NationCommand
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter

public class NationCommand extends BaseCommand implements org.bukkit.command.CommandExecutor
  • Field Details

    • nationTabCompletes

      @VisibleForTesting public static final List<String> nationTabCompletes
    • nationSetTabCompletes

      @VisibleForTesting public static final List<String> nationSetTabCompletes
  • Constructor Details

    • NationCommand

      public NationCommand(Towny instance)
  • Method Details

    • onTabComplete

      public List<String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
      Overrides:
      onTabComplete in class BaseCommand
    • onCommand

      public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String commandLabel, String[] args)
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
    • parseNationCommand

      public void parseNationCommand(org.bukkit.entity.Player player, String[] split) throws TownyException, Exception
      Throws:
      TownyException
      Exception
    • nationRank

      public void nationRank(org.bukkit.entity.Player player, String[] split) throws TownyException
      Throws:
      TownyException
    • listNations

      public void listNations(org.bukkit.command.CommandSender sender, String[] split) throws TownyException
      Send a list of all nations in the universe to player Command: /nation list
      Parameters:
      sender - - Sender (player or console.)
      split - - Current command arguments.
      Throws:
      TownyException - - Thrown when player does not have permission node.
    • newNation

      public static void newNation(org.bukkit.command.CommandSender sender, String name, Town capitalTown, boolean noCharge) throws TownyException
      Ties together the player-run /new nation and the admin-run /ta nation new NAME CAPITAL code. Vets the name supplied, throws the cancellable event and then charges (if required) before creating a new nation.
      Parameters:
      sender - Sender who initiated the creation of the nation.
      name - Nation name to vet.
      capitalTown - Town which will become the capital city.
      noCharge - when true and the Economy is enabled we charge the new nation cost
      Throws:
      TownyException
    • newNation

      public static Nation newNation(String name, Town town) throws TownyException
      Throws:
      TownyException
    • mergeNation

      public void mergeNation(org.bukkit.entity.Player player, String[] split) throws TownyException
      Throws:
      TownyException
    • mergeNation

      public static void mergeNation(org.bukkit.command.CommandSender sender, String[] split, @NotNull @NotNull Nation remainingNation, boolean admin) throws TownyException
      Throws:
      TownyException
    • nationLeave

      public void nationLeave(org.bukkit.entity.Player player) throws TownyException
      Throws:
      TownyException
    • nationDelete

      public void nationDelete(org.bukkit.entity.Player player, String[] split) throws TownyException
      Throws:
      TownyException
    • nationKing

      public void nationKing(org.bukkit.entity.Player player, String[] split)
    • nationAdd

      public void nationAdd(org.bukkit.entity.Player player, String[] names) throws TownyException
      First stage of adding towns to a nation. We go through the player-submitted list of Names, vet them for invite or invite-revocation, then either send them an invite or revoke their invite when a town name is preceded by "-".
      Parameters:
      player - Player using the command.
      names - Names that will be matched to towns.
      Throws:
      TownyException - when no towns were able to be invited.
    • nationAdd

      @Deprecated public static void nationAdd(Nation nation, List<Town> towns)
      Deprecated.
      since 0.100.1.2 use nationAdd(Nation, Town) instead.
      Final stage of adding towns to a nation.
      Parameters:
      nation - Nation being added to.
      towns - List of Town(s) being added to Nation.
    • nationAdd

      public static void nationAdd(Nation nation, Town town)
      Final stage of adding a town to a nation, via joining or via accepting an invite. We re-test the rules for joining a nation in case the town or nation's situation has changed since being sent the invite/join confirmation.
      Parameters:
      nation - Nation which would take on a new Town.
      town - Town which would join the nation.
    • nationKick

      public void nationKick(org.bukkit.entity.Player player, String[] names) throws TownyException
      Throws:
      TownyException
    • nationKick

      public static void nationKick(org.bukkit.command.CommandSender sender, Nation nation, List<Town> kicking)
    • nationSanctionTown

      public static void nationSanctionTown(org.bukkit.command.CommandSender sender, Nation nation, String[] args) throws TownyException
      Throws:
      TownyException
    • nationAddOrRemoveAlly

      public void nationAddOrRemoveAlly(Resident resident, Nation nation, List<Nation> targetNations, boolean add) throws TownyException
      Throws:
      TownyException
    • nationEnemy

      public void nationEnemy(org.bukkit.entity.Player player, String[] split) throws TownyException
      Throws:
      TownyException
    • nationEnemy

      public void nationEnemy(org.bukkit.entity.Player player, Nation nation, List<Nation> enemies, boolean add)
    • nationSet

      public static void nationSet(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Nation nation) throws TownyException
      Throws:
      TownyException
    • nationSetTaxPercentCap

      public static void nationSetTaxPercentCap(org.bukkit.command.CommandSender sender, String[] split, Nation nation) throws TownyException
      Throws:
      TownyException
    • nationSetConqueredTax

      public static void nationSetConqueredTax(org.bukkit.command.CommandSender sender, String[] split, Nation nation) throws TownyException
      Throws:
      TownyException
    • nationToggle

      public static void nationToggle(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Nation nation) throws TownyException
      Throws:
      TownyException
    • nationRename

      public static void nationRename(org.bukkit.entity.Player player, Nation nation, String newName)
    • nationSpawn

      public static void nationSpawn(org.bukkit.entity.Player player, String[] split, boolean ignoreWarning) throws TownyException
      Wrapper for the nationSpawn() method. All calls should be through here unless bypassing for admins.
      Parameters:
      player - - Player.
      split - - Current command arguments.
      ignoreWarning - - Whether to ignore the cost
      Throws:
      TownyException - - Exception.