Class TownCommand
java.lang.Object
com.palmergames.bukkit.towny.command.BaseCommand
com.palmergames.bukkit.towny.command.TownCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
Send a list of all town help commands to player Command: /town
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class com.palmergames.bukkit.towny.command.BaseCommand
numbers, setOnOffCompletes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetTrustedResidentsFromResident
(org.bukkit.entity.Player player) getTrustedTownsFromResident
(org.bukkit.entity.Player player) static boolean
isEdgeBlock
(TownBlockOwner owner, WorldCoord worldCoord, List<WorldCoord> visited) static boolean
isEdgeBlock
(TownBlockOwner owner, List<WorldCoord> worldCoords) void
Send a list of all towns in the universe to player Command: /town liststatic Town
newTown
(TownyWorld world, String name, Resident resident, Coord key, org.bukkit.Location spawn, org.bukkit.entity.Player player) static Town
newTown
(TownyWorld world, String name, Resident resident, Coord key, org.bukkit.Location spawn, org.bukkit.entity.Player player, double cost) static void
Create a new town.static void
newTown
(org.bukkit.entity.Player player, String name, Resident resident, boolean noCharge, boolean adminCreated) Create a new town.boolean
onCommand
(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command cmd, @NotNull String label, String[] args) onTabComplete
(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args) static void
parseTownClaimCommand
(org.bukkit.entity.Player player, String[] split) static void
parseTownMergeCommand
(org.bukkit.command.CommandSender sender, String[] args, @NotNull Town remainingTown, boolean admin) static void
parseTownMergeCommand
(org.bukkit.entity.Player player, String[] args) static void
parseTownOutlawCommand
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
parseTownTrustCommand
(org.bukkit.command.CommandSender sender, String[] args, @Nullable Town town) static void
parseTownTrustTownCommand
(org.bukkit.command.CommandSender sender, String[] args, @Nullable Town town) static void
parseTownUnclaimCommand
(org.bukkit.entity.Player player, String[] split) static void
setTownBlockOwnerPermissions
(org.bukkit.command.CommandSender sender, Town town, String[] split) static void
setTownBlockPermissions
(org.bukkit.command.CommandSender sender, TownBlockOwner townBlockOwner, TownyPermission perm, String[] split, boolean friend) static void
setTownForSale
(Town town, double price, boolean admin) static void
setTownNotForSale
(Town town, boolean admin) static void
Checks if the player is allowed to handle adding invites, then checks through a list of names to be invited, or to have their invites revoked.static void
townAddResident
(Town town, Resident resident) static void
townAddResidents
(org.bukkit.command.CommandSender sender, Town town, List<Resident> invited) static void
townBuy
(org.bukkit.command.CommandSender sender, String[] split, @Nullable Town town, boolean admin) static void
townBuyBonus
(Town town, String[] split, org.bukkit.command.CommandSender sender) Town tries to buy bonus blocks or checks the cost and increase.static void
townBuyBonusTownBlocks
(Town town, int inputN, org.bukkit.command.CommandSender sender) Town buys bonus blocks after checking the configured maximum.void
townDelete
(org.bukkit.entity.Player player, String[] split) static void
Transforms a list of names into a list of residents to be kicked.void
townLeave
(org.bukkit.entity.Player player) void
static void
townRename
(org.bukkit.command.CommandSender sender, Town town, String newName) static void
static void
townSetBoard
(org.bukkit.command.CommandSender sender, String board, Town town) static void
townSetEmbassyPrice
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetEmbassyTax
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetHomeblock
(org.bukkit.command.CommandSender sender, Town town) static void
townSetMapColor
(org.bukkit.command.CommandSender sender, String[] split, Town town) static void
townSetMayor
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town, Resident resident) static void
townSetName
(org.bukkit.command.CommandSender sender, String[] split, Town town) static void
townSetOutpost
(org.bukkit.command.CommandSender sender, Town town) static void
townSetPlotPrice
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetPlotTax
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetPrimaryJail
(org.bukkit.command.CommandSender sender, Town town) static void
townSetShopPrice
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetShopTax
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetSpawn
(org.bukkit.command.CommandSender sender, Town town, boolean admin) static void
townSetSpawnCost
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetSurname
(org.bukkit.command.CommandSender sender, String[] split, boolean admin) static void
townSetTag
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetTaxes
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) static void
townSetTaxPercent
(org.bukkit.command.CommandSender sender, String[] split, Town town) static void
townSetTitle
(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] split, boolean admin) static void
Wrapper for the townSpawn() method.static void
townToggle
(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) 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
-
townTabCompletes
-
townSetTabCompletes
-
townUnclaimTabCompletes
-
-
Constructor Details
-
TownCommand
-
-
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(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command cmd, @NotNull @NotNull String label, String[] args) - Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
-
parseTownOutlawCommand
public static void parseTownOutlawCommand(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
listTowns
public void listTowns(org.bukkit.command.CommandSender sender, String[] split) throws TownyException Send a list of all towns in the universe to player Command: /town list- Parameters:
sender
- - Sender (player or console.)split
- - Current command arguments.- Throws:
TownyException
- when a player lacks the permission node.
-
townToggle
public static void townToggle(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townRank
- Throws:
TownyException
-
townSet
public static void townSet(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetBoard
public static void townSetBoard(org.bukkit.command.CommandSender sender, String board, Town town) throws TownyException - Throws:
TownyException
-
townSetTitle
public static void townSetTitle(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] split, boolean admin) throws TownyException - Throws:
TownyException
-
townSetSurname
public static void townSetSurname(org.bukkit.command.CommandSender sender, String[] split, boolean admin) throws TownyException - Throws:
TownyException
-
townSetMayor
public static void townSetMayor(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town, Resident resident) throws TownyException - Throws:
TownyException
-
townSetTaxes
public static void townSetTaxes(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetPlotTax
public static void townSetPlotTax(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetShopTax
public static void townSetShopTax(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetEmbassyTax
public static void townSetEmbassyTax(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetPlotPrice
public static void townSetPlotPrice(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetShopPrice
public static void townSetShopPrice(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetEmbassyPrice
public static void townSetEmbassyPrice(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetSpawnCost
public static void townSetSpawnCost(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetName
public static void townSetName(org.bukkit.command.CommandSender sender, String[] split, Town town) throws TownyException - Throws:
TownyException
-
townSetTag
public static void townSetTag(org.bukkit.command.CommandSender sender, String[] split, boolean admin, Town town) throws TownyException - Throws:
TownyException
-
townSetHomeblock
public static void townSetHomeblock(org.bukkit.command.CommandSender sender, Town town) throws TownyException - Throws:
TownyException
-
townSetSpawn
public static void townSetSpawn(org.bukkit.command.CommandSender sender, Town town, boolean admin) throws TownyException - Throws:
TownyException
-
townSetOutpost
public static void townSetOutpost(org.bukkit.command.CommandSender sender, Town town) throws TownyException - Throws:
TownyException
-
townSetPrimaryJail
public static void townSetPrimaryJail(org.bukkit.command.CommandSender sender, Town town) throws TownyException - Throws:
TownyException
-
townSetMapColor
public static void townSetMapColor(org.bukkit.command.CommandSender sender, String[] split, Town town) throws TownyException - Throws:
TownyException
-
townSetTaxPercent
public static void townSetTaxPercent(org.bukkit.command.CommandSender sender, String[] split, Town town) throws TownyException - Throws:
TownyException
-
townBuy
public static void townBuy(org.bukkit.command.CommandSender sender, String[] split, @Nullable @Nullable Town town, boolean admin) throws TownyException - Throws:
TownyException
-
townBuyBonus
public static void townBuyBonus(Town town, String[] split, org.bukkit.command.CommandSender sender) throws TownyException Town tries to buy bonus blocks or checks the cost and increase.- Parameters:
town
- - Towm object.split
- - List of command arguments.sender
- - Player.- Throws:
TownyException
- - Exception.
-
townBuyBonusTownBlocks
public static void townBuyBonusTownBlocks(Town town, int inputN, org.bukkit.command.CommandSender sender) throws TownyException Town buys bonus blocks after checking the configured maximum.- Parameters:
town
- - Towm object.inputN
- - Number of townblocks being bought.sender
- - Player.- Throws:
TownyException
- - Exception.
-
newTown
public static void newTown(org.bukkit.entity.Player player, String name, Resident resident, boolean noCharge) throws TownyException Create a new town. Command: /town new [town]- Parameters:
player
- - Player.name
- - name of townresident
- - The resident in charge of the town.noCharge
- - charging for creation - /ta town new NAME MAYOR has no charge.- Throws:
TownyException
- when a new town isn't allowed.
-
newTown
public static void newTown(org.bukkit.entity.Player player, String name, Resident resident, boolean noCharge, boolean adminCreated) throws TownyException Create a new town. Command: /town new [townname] or /ta town new [townname]- Parameters:
player
- Player using the command.name
- Name of townresident
- The resident in charge of the town.noCharge
- Charging for creation - /ta town new NAME MAYOR has no charge.adminCreated
- true when an admin has used /ta town new [NAME].- Throws:
TownyException
- when a new town isn't allowed.
-
newTown
public static Town newTown(TownyWorld world, String name, Resident resident, Coord key, org.bukkit.Location spawn, org.bukkit.entity.Player player) throws TownyException - Throws:
TownyException
-
newTown
public static Town newTown(TownyWorld world, String name, Resident resident, Coord key, org.bukkit.Location spawn, org.bukkit.entity.Player player, double cost) throws TownyException - Throws:
TownyException
-
townRename
-
townLeave
- Throws:
TownyException
-
townSpawn
public static void townSpawn(org.bukkit.entity.Player player, String[] split, Boolean outpost, boolean ignoreWarning) throws TownyException Wrapper for the townSpawn() method. All calls should be through here unless bypassing for admins.- Parameters:
player
- - Player.split
- - Current command arguments.outpost
- - Whether this in an outpost or not.ignoreWarning
- - Whether to ignore cost warning and pay automatically.- Throws:
TownyException
- - Exception.
-
townDelete
- Throws:
TownyException
-
townAddResidents
public static void townAddResidents(org.bukkit.command.CommandSender sender, Town town, List<Resident> invited) throws TownyException - Throws:
TownyException
-
townAddResident
- Throws:
AlreadyRegisteredException
-
townKick
Transforms a list of names into a list of residents to be kicked. Command: /town kick [resident] .. [resident]- Parameters:
player
- - Player who initiated the kick command.names
- - List of names to kick.- Throws:
TownyException
- on error.
-
townAdd
public static void townAdd(org.bukkit.command.CommandSender sender, Town specifiedTown, String[] names) throws TownyException Checks if the player is allowed to handle adding invites, then checks through a list of names to be invited, or to have their invites revoked. Will dispatch invites and/or revoke invites from names beginning with -.- Parameters:
sender
- Sender.specifiedTown
- Town to add to if not null.names
- Names to add.- Throws:
TownyException
- Thrown when an the invites are not allowed because of lack of permissions, ruined/bankruptcy, or the town having no spawn set.
-
setTownBlockOwnerPermissions
public static void setTownBlockOwnerPermissions(org.bukkit.command.CommandSender sender, Town town, String[] split) throws TownyException - Throws:
TownyException
-
setTownBlockPermissions
public static void setTownBlockPermissions(org.bukkit.command.CommandSender sender, TownBlockOwner townBlockOwner, TownyPermission perm, String[] split, boolean friend) -
parseTownClaimCommand
public static void parseTownClaimCommand(org.bukkit.entity.Player player, String[] split) throws TownyException - Throws:
TownyException
-
parseTownUnclaimCommand
public static void parseTownUnclaimCommand(org.bukkit.entity.Player player, String[] split) throws TownyException - Throws:
TownyException
-
parseTownMergeCommand
public static void parseTownMergeCommand(org.bukkit.entity.Player player, String[] args) throws TownyException - Throws:
TownyException
-
parseTownMergeCommand
public static void parseTownMergeCommand(org.bukkit.command.CommandSender sender, String[] args, @NotNull @NotNull Town remainingTown, boolean admin) throws TownyException - Throws:
TownyException
-
isEdgeBlock
-
isEdgeBlock
public static boolean isEdgeBlock(TownBlockOwner owner, WorldCoord worldCoord, List<WorldCoord> visited) -
parseTownTrustCommand
public static void parseTownTrustCommand(org.bukkit.command.CommandSender sender, String[] args, @Nullable @Nullable Town town) throws TownyException - Throws:
TownyException
-
parseTownTrustTownCommand
public static void parseTownTrustTownCommand(org.bukkit.command.CommandSender sender, String[] args, @Nullable @Nullable Town town) throws TownyException - Throws:
TownyException
-
getTrustedResidentsFromResident
-
getTrustedTownsFromResident
-
setTownForSale
-
setTownNotForSale
-