Class District
java.lang.Object
com.palmergames.bukkit.towny.object.TownyObject
com.palmergames.bukkit.towny.object.ObjectGroup
com.palmergames.bukkit.towny.object.District
- All Implemented Interfaces:
Identifiable,Nameable,Savable
- Author:
- LlmDl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTownBlock(TownBlock townBlock) booleanDetermines whether a group is equivalent or not.booleanexists()An internal method used to determine if an object exists in the TownyUniverse's maps.getTown()inthashCode()Get hashcode for object group name.booleanhasTownBlock(TownBlock townBlock) booleanvoidremoveTownBlock(TownBlock townBlock) voidsave()Schedules the object to be saved to the database.voidOverride the name change method to internally rehash the district map.voidvoidsetTownblocks(List<TownBlock> townBlocks) toString()Store district in format "name,id,town,price"Methods inherited from class com.palmergames.bukkit.towny.object.ObjectGroup
getUUID, 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
-
District
- Parameters:
id- A unique identifier for the district id.name- An alias for the id used for player in-game interaction via commands.town- The town that this district is owned by.
-
-
Method Details
-
toString
Store district 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 district map.- Overrides:
setNamein classTownyObject- Parameters:
name- The name of the district.
-
setTown
-
hashCode
public int hashCode()Description copied from class:ObjectGroupGet hashcode for object group name. The reason we hash the name and not the UUID is for quicker common access from commands.- Overrides:
hashCodein classObjectGroup- Returns:
- name hashcode
-
equals
Description copied from class:ObjectGroupDetermines whether a group is equivalent or not.- Overrides:
equalsin classObjectGroup- Parameters:
obj- The group to be compared- Returns:
- Returns true if the id (UUID) of the group matches the given group object. False otherwise.
-
getTown
-
toModeString
- Returns:
- The qualified resident mode string.
-
addTownBlock
-
removeTownBlock
-
setTownblocks
-
getTownBlocks
-
hasTownBlocks
public boolean hasTownBlocks() -
hasTownBlock
-
save
public void save()Description copied from interface:SavableSchedules the object to be saved to the database.
-