Class PlotGroup
java.lang.Object
com.palmergames.bukkit.towny.object.TownyObject
com.palmergames.bukkit.towny.object.ObjectGroup
com.palmergames.bukkit.towny.object.PlotGroup
- All Implemented Interfaces:
Identifiable,Nameable,Permissible,Savable,TownBlockOwner
- Author:
- Suneet Tipirneni (Siris) A simple class which encapsulates the grouping of townblocks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlotPrice(double pPrice) voidaddTownBlock(TownBlock townBlock) Adds a townblock to the list of existing townblocks.voidaddTrustedResident(Resident resident) booleanexists()An internal method used to determine if an object exists in the TownyUniverse's maps.intintGets the permissions of the object.doublegetPrice()@Nullable ResidentgetTown()Gets the unmodifiable collection of townblocks.booleanbooleanhasTownBlock(TownBlock townBlock) Checks whether object has townblock or not.booleanbooleanhasTrustedResident(Resident resident) voidputPermissionOverride(Resident resident, PermissionData permissionData) voidremovePermissionOverride(Resident resident) voidremoveTownBlock(TownBlock townBlock) Removes townblock from the list of existing townblocks.voidremoveTrustedResident(Resident resident) voidsave()Schedules the object to be saved to the database.voidOverride the name change method to internally rehash the plot group map.voidsetPermissionOverrides(Map<Resident, PermissionData> permissionOverrides) voidsetPermissions(TownyPermission permissions) voidsetPermissions(String line) The the permissions of this object.voidsetPrice(double price) voidsetResident(Resident resident) voidvoidsetTownblocks(List<TownBlock> townBlocks) voidsetTrustedResidents(Set<Resident> trustedResidents) toString()Store plot group in format "name,id,town,price"Methods inherited from class com.palmergames.bukkit.towny.object.ObjectGroup
equals, getUUID, hashCode, setUUIDMethods inherited from class com.palmergames.bukkit.towny.object.TownyObject
addMetaData, addMetaData, getMetadata, getMetadata, getMetadata, getName, getTreeDepth, getTreeString, hasMeta, hasMeta, hasMeta, removeMetaData, removeMetaData, removeMetaData, removeMetaDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.palmergames.bukkit.towny.object.Nameable
getFormattedName, getName
-
Constructor Details
-
PlotGroup
- Parameters:
id- A unique identifier for the group id.name- An alias for the id used for player in-game interaction via commands.town- The town that this group is owned by.
-
-
Method Details
-
toString
Store plot group in format "name,id,town,price"- Overrides:
toStringin classObjectGroup- Returns:
- The string in the format described.
-
exists
public boolean exists()Description copied from class:TownyObjectAn internal method used to determine if an object exists in the TownyUniverse's maps.- Specified by:
existsin classTownyObject- Returns:
- true if this TownyObject exists.
-
setName
Override the name change method to internally rehash the plot group map.- Overrides:
setNamein classTownyObject- Parameters:
name- The name of the group.
-
setTown
-
getTown
-
toModeString
- Returns:
- The qualified resident mode string.
-
getPrice
public double getPrice() -
setResident
-
getResident
-
hasResident
public boolean hasResident() -
addTownBlock
Description copied from interface:TownBlockOwnerAdds a townblock to the list of existing townblocks.- Specified by:
addTownBlockin interfaceTownBlockOwner- Parameters:
townBlock- The townblock to add.
-
removeTownBlock
Description copied from interface:TownBlockOwnerRemoves townblock from the list of existing townblocks.- Specified by:
removeTownBlockin interfaceTownBlockOwner- Parameters:
townBlock- The townblock to remove.
-
setTownblocks
-
getTownBlocks
Description copied from interface:TownBlockOwnerGets the unmodifiable collection of townblocks.- Specified by:
getTownBlocksin interfaceTownBlockOwner- Returns:
- The townblocks this object contains.
-
hasTownBlocks
public boolean hasTownBlocks() -
hasTownBlock
Description copied from interface:TownBlockOwnerChecks whether object has townblock or not.- Specified by:
hasTownBlockin interfaceTownBlockOwner- Parameters:
townBlock- The townblock to check for.- Returns:
- A boolean indicating if it was found or not.
-
setPrice
public void setPrice(double price) -
addPlotPrice
public void addPlotPrice(double pPrice) -
setPermissions
Description copied from interface:PermissibleThe the permissions of this object.- Specified by:
setPermissionsin interfacePermissible- Parameters:
line- The String line representation of the permissions.
-
getPermissions
Description copied from interface:PermissibleGets the permissions of the object.- Specified by:
getPermissionsin interfacePermissible- Returns:
TownyPermissionthe permissions of the object.
-
setPermissions
-
getTownBlockType
-
save
public void save()Description copied from interface:SavableSchedules the object to be saved to the database. -
setTrustedResidents
-
getTrustedResidents
-
setPermissionOverrides
-
getPermissionOverrides
-
hasTrustedResident
-
addTrustedResident
-
removeTrustedResident
-
putPermissionOverride
-
removePermissionOverride
-
getMinTownMembershipDays
public int getMinTownMembershipDays() -
getMaxTownMembershipDays
public int getMaxTownMembershipDays()
-