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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlotPrice
(double pPrice) void
addTownBlock
(TownBlock townBlock) Adds a townblock to the list of existing townblocks.void
addTrustedResident
(Resident resident) boolean
exists()
An internal method used to determine if an object exists in the TownyUniverse's maps.Gets the permissions of the object.double
getPrice()
@Nullable Resident
getTown()
Gets the unmodifiable collection of townblocks.boolean
boolean
hasTownBlock
(TownBlock townBlock) Checks whether object has townblock or not.boolean
boolean
hasTrustedResident
(Resident resident) void
putPermissionOverride
(Resident resident, PermissionData permissionData) void
removePermissionOverride
(Resident resident) void
removeTownBlock
(TownBlock townBlock) Removes townblock from the list of existing townblocks.void
removeTrustedResident
(Resident resident) void
save()
Schedules the object to be saved to the database.void
Override the name change method to internally rehash the plot group map.void
setPermissionOverrides
(Map<Resident, PermissionData> permissionOverrides) void
setPermissions
(TownyPermission permissions) void
setPermissions
(String line) The the permissions of this object.void
setPrice
(double price) void
setResident
(Resident resident) void
void
setTownblocks
(List<TownBlock> townBlocks) void
setTrustedResidents
(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, setUUID
Methods inherited from class com.palmergames.bukkit.towny.object.TownyObject
addMetaData, addMetaData, getMetadata, getMetadata, getMetadata, getName, getTreeDepth, getTreeString, hasMeta, hasMeta, hasMeta, removeMetaData, removeMetaData, removeMetaData, removeMetaData
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
toString
in classObjectGroup
- Returns:
- The string in the format described.
-
exists
public boolean exists()Description copied from class:TownyObject
An internal method used to determine if an object exists in the TownyUniverse's maps.- Specified by:
exists
in classTownyObject
- Returns:
- true if this TownyObject exists.
-
setName
Override the name change method to internally rehash the plot group map.- Overrides:
setName
in 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:TownBlockOwner
Adds a townblock to the list of existing townblocks.- Specified by:
addTownBlock
in interfaceTownBlockOwner
- Parameters:
townBlock
- The townblock to add.
-
removeTownBlock
Description copied from interface:TownBlockOwner
Removes townblock from the list of existing townblocks.- Specified by:
removeTownBlock
in interfaceTownBlockOwner
- Parameters:
townBlock
- The townblock to remove.
-
setTownblocks
-
getTownBlocks
Description copied from interface:TownBlockOwner
Gets the unmodifiable collection of townblocks.- Specified by:
getTownBlocks
in interfaceTownBlockOwner
- Returns:
- The townblocks this object contains.
-
hasTownBlocks
public boolean hasTownBlocks() -
hasTownBlock
Description copied from interface:TownBlockOwner
Checks whether object has townblock or not.- Specified by:
hasTownBlock
in 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:Permissible
The the permissions of this object.- Specified by:
setPermissions
in interfacePermissible
- Parameters:
line
- The String line representation of the permissions.
-
getPermissions
Description copied from interface:Permissible
Gets the permissions of the object.- Specified by:
getPermissions
in interfacePermissible
- Returns:
TownyPermission
the permissions of the object.
-
setPermissions
-
getTownBlockType
-
save
public void save()Description copied from interface:Savable
Schedules the object to be saved to the database. -
setTrustedResidents
-
getTrustedResidents
-
setPermissionOverrides
-
getPermissionOverrides
-
hasTrustedResident
-
addTrustedResident
-
removeTrustedResident
-
putPermissionOverride
-
removePermissionOverride
-