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
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class com.palmergames.bukkit.towny.command.BaseCommand
numbers, setOnOffCompletes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
listNations
(org.bukkit.command.CommandSender sender, String[] split) Send a list of all nations in the universe to player Command: /nation liststatic void
mergeNation
(org.bukkit.command.CommandSender sender, String[] split, @NotNull Nation remainingNation, boolean admin) void
mergeNation
(org.bukkit.entity.Player player, String[] split) static void
Final stage of adding a town to a nation, via joining or via accepting an invite.static void
Deprecated.void
First stage of adding towns to a nation.void
nationAddOrRemoveAlly
(Resident resident, Nation nation, List<Nation> targetNations, boolean add) void
nationDelete
(org.bukkit.entity.Player player, String[] split) void
nationEnemy
(org.bukkit.entity.Player player, Nation nation, List<Nation> enemies, boolean add) void
nationEnemy
(org.bukkit.entity.Player player, String[] split) static void
nationKick
(org.bukkit.command.CommandSender sender, Nation nation, List<Town> kicking) void
nationKick
(org.bukkit.entity.Player player, String[] names) void
nationKing
(org.bukkit.entity.Player player, String[] split) void
nationLeave
(org.bukkit.entity.Player player) void
nationRank
(org.bukkit.entity.Player player, String[] split) static void
nationRename
(org.bukkit.entity.Player player, Nation nation, String newName) static void
nationSanctionTown
(org.bukkit.command.CommandSender sender, Nation nation, String[] args) static void
static void
nationSetConqueredTax
(org.bukkit.command.CommandSender sender, String[] split, Nation nation) static void
nationSetTaxPercentCap
(org.bukkit.command.CommandSender sender, String[] split, Nation nation) static void
nationSpawn
(org.bukkit.entity.Player player, String[] split, boolean ignoreWarning) Wrapper for the nationSpawn() method.static void
nationToggle
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Nation nation) static Nation
static void
Ties together the player-run /new nation and the admin-run /ta nation new NAME CAPITAL code.boolean
onCommand
(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String commandLabel, String[] args) onTabComplete
(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args) void
parseNationCommand
(org.bukkit.entity.Player player, String[] split) Methods inherited from class com.palmergames.bukkit.towny.command.BaseCommand
catchConsole, catchNPCResident, catchPlayer, checkPermOrThrow, checkPermOrThrowWithMessage, filterByStartOrGetTownyStartingWith, getNationFromPlayerOrThrow, getNationFromResidentOrThrow, getNationFromTownOrThrow, getNationOrThrow, getNationResidentNamesOfPlayerStartingWith, getResidentOrThrow, getResidentOrThrow, getResidentOrThrow, getResidentsOfTownStartingWith, getResidentsWithoutTownStartingWith, getTownFromPlayerOrThrow, getTownFromResidentOrThrow, getTownOrThrow, getTownResidentNamesOfPlayerStartingWith, getTownyStartingWith, getVisibleResidentsForPlayerWithoutTownsStartingWith, parseToggleChoice, prettyMoney
-
Field Details
-
nationTabCompletes
-
nationSetTabCompletes
-
-
Constructor Details
-
NationCommand
-
-
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 interfaceorg.bukkit.command.TabCompleter
- Overrides:
onTabComplete
in classBaseCommand
-
onCommand
public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String commandLabel, String[] args) - Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
-
parseNationCommand
public void parseNationCommand(org.bukkit.entity.Player player, String[] split) throws TownyException, Exception - Throws:
TownyException
Exception
-
nationRank
- 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
- Throws:
TownyException
-
mergeNation
- 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
- Throws:
TownyException
-
nationDelete
- Throws:
TownyException
-
nationKing
-
nationAdd
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.since 0.100.1.2 usenationAdd(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
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
- Throws:
TownyException
-
nationKick
-
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
- Throws:
TownyException
-
nationEnemy
-
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
-
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.
-
nationAdd(Nation, Town)
instead.