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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTownBlock
(TownBlock townBlock) boolean
Determines whether a group is equivalent or not.boolean
exists()
An internal method used to determine if an object exists in the TownyUniverse's maps.getTown()
int
hashCode()
Get hashcode for object group name.boolean
hasTownBlock
(TownBlock townBlock) boolean
void
removeTownBlock
(TownBlock townBlock) void
save()
Schedules the object to be saved to the database.void
Override the name change method to internally rehash the district map.void
void
setTownblocks
(List<TownBlock> townBlocks) toString()
Store district in format "name,id,town,price"Methods inherited from class com.palmergames.bukkit.towny.object.ObjectGroup
getUUID, 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
-
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:
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 district map.- Overrides:
setName
in classTownyObject
- Parameters:
name
- The name of the district.
-
setTown
-
hashCode
public int hashCode()Description copied from class:ObjectGroup
Get hashcode for object group name. The reason we hash the name and not the UUID is for quicker common access from commands.- Overrides:
hashCode
in classObjectGroup
- Returns:
- name hashcode
-
equals
Description copied from class:ObjectGroup
Determines whether a group is equivalent or not.- Overrides:
equals
in 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:Savable
Schedules the object to be saved to the database.
-