public class Town extends TownBlockOwner implements Walled, ResidentList
| Constructor and Description |
|---|
Town(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBonusBlocks(int bonusBlocks) |
void |
addOutpostSpawn(org.bukkit.Location spawn)
Add or update an outpost spawn
|
void |
addPurchasedBlocks(int purchasedBlocks) |
void |
addResident(Resident resident) |
void |
addResidentCheck(Resident resident) |
void |
addTownBlock(TownBlock townBlock) |
void |
addWallSection(WallSection wallSection) |
void |
clear() |
void |
collect(double amount) |
void |
forceAddOutpostSpawn(org.bukkit.Location spawn)
Only to be called from the Loading methods.
|
void |
forceSetHomeBlock(TownBlock homeBlock)
Only to be called from the Loading methods.
|
void |
forceSetSpawn(org.bukkit.Location spawn)
Only to be called from the Loading methods.
|
java.util.List<org.bukkit.Location> |
getAllOutpostSpawns()
Get an unmodifiable List of all outpost spawns.
|
java.util.List<Resident> |
getAssistants() |
double |
getBonusBlockCost() |
double |
getBonusBlockCostN(int inputN) |
int |
getBonusBlocks() |
double |
getCommercialPlotPrice() |
double |
getCommercialPlotTax() |
java.lang.String |
getEconomyName()
Get a valid economy account name for this object.
|
double |
getEmbassyPlotPrice() |
double |
getEmbassyPlotTax() |
TownBlock |
getHomeBlock() |
int |
getMaxOutpostSpawn() |
Resident |
getMayor() |
Nation |
getNation() |
int |
getNumResidents() |
org.bukkit.Location |
getOutpostSpawn(java.lang.Integer index)
Return the Location for this Outpost index.
|
double |
getPlotPrice() |
double |
getPlotTax() |
double |
getPlotTypePrice(TownBlockType type) |
int |
getPurchasedBlocks() |
java.util.List<Resident> |
getResidents() |
org.bukkit.Location |
getSpawn() |
java.lang.String |
getTag() |
double |
getTaxes() |
int |
getTotalBlocks() |
java.lang.String |
getTownBoard() |
java.util.List<java.lang.String> |
getTreeString(int depth) |
Wall |
getWall() |
java.util.List<WallSection> |
getWallSections() |
TownyWorld |
getWorld()
Fetch the World this town is registered too.
|
boolean |
hasAssistant(Resident resident) |
boolean |
hasHomeBlock() |
boolean |
hasMayor() |
boolean |
hasMobs() |
boolean |
hasNation() |
boolean |
hasOutpostSpawn() |
boolean |
hasResident(Resident resident) |
boolean |
hasResident(java.lang.String name) |
boolean |
hasSpawn() |
boolean |
hasTag() |
boolean |
hasUpkeep() |
boolean |
hasWallSection(WallSection wallSection) |
boolean |
hasWorld() |
boolean |
isAdminDisabledPVP() |
boolean |
isAdminEnabledPVP() |
boolean |
isBANG() |
boolean |
isCapital() |
boolean |
isFire() |
boolean |
isHomeBlock(TownBlock townBlock) |
boolean |
isMayor(Resident resident) |
boolean |
isOpen() |
boolean |
isPublic() |
boolean |
isPVP() |
boolean |
isTaxPercentage() |
void |
removeResident(Resident resident) |
void |
removeTownBlock(TownBlock townBlock) |
void |
removeWallSection(WallSection wallSection) |
void |
setAdminDisabledPVP(boolean isPVPDisabled) |
void |
setAdminEnabledPVP(boolean isPVPEnabled) |
void |
setBANG(boolean isBANG) |
void |
setBonusBlocks(int bonusBlocks) |
void |
setCommercialPlotPrice(double commercialPlotPrice) |
void |
setCommercialPlotTax(double commercialTax) |
void |
setEmbassyPlotPrice(double embassyPlotPrice) |
void |
setEmbassyPlotTax(double embassyPlotTax) |
void |
setFire(boolean isFire) |
void |
setHasMobs(boolean hasMobs) |
void |
setHasUpkeep(boolean hasUpkeep) |
boolean |
setHomeBlock(TownBlock homeBlock) |
void |
setMayor(Resident mayor) |
void |
setNation(Nation nation) |
void |
setOpen(boolean isOpen) |
void |
setPlotPrice(double plotPrice) |
void |
setPlotTax(double plotTax) |
void |
setPublic(boolean isPublic) |
void |
setPurchasedBlocks(int purchasedBlocks) |
void |
setPVP(boolean isPVP) |
void |
setSpawn(org.bukkit.Location spawn) |
void |
setTag(java.lang.String text) |
void |
setTaxes(double taxes) |
void |
setTaxPercentage(boolean isPercentage) |
void |
setTownBoard(java.lang.String townBoard) |
void |
setWallSections(java.util.List<WallSection> wallSections) |
void |
setWorld(TownyWorld world)
Sets the world this town belongs to.
|
void |
withdrawFromBank(Resident resident,
int amount) |
getPermissions, getTownBlocks, hasTownBlock, setPermissions, setTownblockscanPayFromHoldings, collect, getHoldingBalance, getHoldingFormattedBalance, pay, payTo, removeAccount, setBalancegetFormattedName, getName, getTreeDepth, getUID, isChangedName, setChangedName, setName, setUID, toStringpublic void addTownBlock(TownBlock townBlock) throws AlreadyRegisteredException
addTownBlock in class TownBlockOwnerAlreadyRegisteredExceptionpublic void setTag(java.lang.String text)
throws TownyException
TownyExceptionpublic java.lang.String getTag()
public boolean hasTag()
public Resident getMayor()
public void setTaxes(double taxes)
public double getTaxes()
public void setMayor(Resident mayor) throws TownyException
TownyExceptionpublic Nation getNation() throws NotRegisteredException
NotRegisteredExceptionpublic void setNation(Nation nation) throws AlreadyRegisteredException
AlreadyRegisteredExceptionpublic java.util.List<Resident> getResidents()
getResidents in interface ResidentListpublic java.util.List<Resident> getAssistants()
public boolean hasResident(java.lang.String name)
hasResident in interface ResidentListpublic boolean hasResident(Resident resident)
public boolean hasAssistant(Resident resident)
public void addResident(Resident resident) throws AlreadyRegisteredException
AlreadyRegisteredExceptionpublic void addResidentCheck(Resident resident) throws AlreadyRegisteredException
AlreadyRegisteredExceptionpublic boolean isMayor(Resident resident)
public boolean hasNation()
public int getNumResidents()
public boolean isCapital()
public void setHasUpkeep(boolean hasUpkeep)
public boolean hasUpkeep()
public void setHasMobs(boolean hasMobs)
public boolean hasMobs()
public void setPVP(boolean isPVP)
public void setAdminDisabledPVP(boolean isPVPDisabled)
public void setAdminEnabledPVP(boolean isPVPEnabled)
public boolean isPVP()
public boolean isAdminDisabledPVP()
public boolean isAdminEnabledPVP()
public void setBANG(boolean isBANG)
public boolean isBANG()
public void setTaxPercentage(boolean isPercentage)
public boolean isTaxPercentage()
public void setFire(boolean isFire)
public boolean isFire()
public void setTownBoard(java.lang.String townBoard)
public java.lang.String getTownBoard()
public void setBonusBlocks(int bonusBlocks)
public int getTotalBlocks()
public int getBonusBlocks()
public double getBonusBlockCost()
public double getBonusBlockCostN(int inputN)
throws TownyException
TownyExceptionpublic void addBonusBlocks(int bonusBlocks)
public void setPurchasedBlocks(int purchasedBlocks)
public int getPurchasedBlocks()
public void addPurchasedBlocks(int purchasedBlocks)
public boolean setHomeBlock(TownBlock homeBlock) throws TownyException
homeBlock - TownyExceptionpublic void forceSetHomeBlock(TownBlock homeBlock) throws TownyException
homeBlock - TownyExceptionpublic TownBlock getHomeBlock() throws TownyException
TownyExceptionpublic void setWorld(TownyWorld world)
world - public TownyWorld getWorld()
public boolean hasMayor()
public void removeResident(Resident resident) throws EmptyTownException, NotRegisteredException
public void setSpawn(org.bukkit.Location spawn)
throws TownyException
TownyExceptionpublic void forceSetSpawn(org.bukkit.Location spawn)
spawn - public org.bukkit.Location getSpawn()
throws TownyException
TownyExceptionpublic boolean hasSpawn()
public boolean hasHomeBlock()
public void clear()
throws EmptyNationException
EmptyNationExceptionpublic boolean hasWorld()
public void removeTownBlock(TownBlock townBlock) throws NotRegisteredException
removeTownBlock in class TownBlockOwnerNotRegisteredExceptionpublic void addOutpostSpawn(org.bukkit.Location spawn)
throws TownyException
spawn - TownyExceptionpublic void forceAddOutpostSpawn(org.bukkit.Location spawn)
spawn - public org.bukkit.Location getOutpostSpawn(java.lang.Integer index)
throws TownyException
index - TownyExceptionpublic int getMaxOutpostSpawn()
public boolean hasOutpostSpawn()
public java.util.List<org.bukkit.Location> getAllOutpostSpawns()
public void setPlotPrice(double plotPrice)
public double getPlotPrice()
public double getPlotTypePrice(TownBlockType type)
public void setCommercialPlotPrice(double commercialPlotPrice)
public double getCommercialPlotPrice()
public void setEmbassyPlotPrice(double embassyPlotPrice)
public double getEmbassyPlotPrice()
public java.util.List<WallSection> getWallSections()
getWallSections in interface Walledpublic void setWallSections(java.util.List<WallSection> wallSections)
setWallSections in interface Walledpublic boolean hasWallSection(WallSection wallSection)
hasWallSection in interface Walledpublic void addWallSection(WallSection wallSection)
addWallSection in interface Walledpublic void removeWallSection(WallSection wallSection)
removeWallSection in interface Walledpublic boolean isHomeBlock(TownBlock townBlock)
public void setPlotTax(double plotTax)
public double getPlotTax()
public void setCommercialPlotTax(double commercialTax)
public double getCommercialPlotTax()
public void setEmbassyPlotTax(double embassyPlotTax)
public double getEmbassyPlotTax()
public void setOpen(boolean isOpen)
public boolean isOpen()
public void collect(double amount)
throws EconomyException
EconomyExceptionpublic void withdrawFromBank(Resident resident, int amount) throws EconomyException, TownyException
EconomyExceptionTownyExceptionpublic java.util.List<java.lang.String> getTreeString(int depth)
getTreeString in class TownyObjectpublic void setPublic(boolean isPublic)
public boolean isPublic()
public java.lang.String getEconomyName()
TownyEconomyObjectgetEconomyName in class TownyEconomyObject