Package com.palmergames.bukkit.towny
Class TownyFormatter
java.lang.Object
com.palmergames.bukkit.towny.TownyFormatter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final SimpleDateFormatstatic final Stringstatic final Stringstatic final Stringstatic final SimpleDateFormatstatic final SimpleDateFormatstatic final String1 = Description 2 = Count Colours: 3 = Description and : 4 = Count 5 = Colour for the start of the liststatic final SimpleDateFormat -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcolourBracketElement(String key, String value) static StringcolourHoverKey(String key) static Stringstatic StringcolourKeyImportant(String key) static StringcolourKeyValue(String key, String value) static StringformatPopulationBrackets(int size) static List<net.kyori.adventure.text.Component> Returns a list of MetaData used in the StatusScreens.static String[]getFormattedNames(TownyObject[] objs) Returns an Array of names, using their Formatted (long) names, with ColourCodes translated.getFormattedNames(Collection<? extends Nameable> objects) static StringgetFormattedOnlineResidents(String prefix, ResidentList residentList, org.bukkit.entity.Player player) Used in /n online and /t online.static StringgetFormattedResidentRegistration(Resident resident) static StringgetFormattedStrings(String prefix, List<String> list) Used to prefix, count and list the given strings.static StringgetFormattedStrings(String prefix, List<String> list, int size) Used to prefix, count and list the given strings.Returns a list of names, with ColourCodes translated.static StringgetFormattedTownyObjects(String prefix, List<TownyObject> objectlist) Used to prefix, count and list the given object.getNationSubtitle(Nation nation, Translator translator) Returns the 2nd line of the Nation StatusScreen.getRanksForNation(Nation nation, Translator translator) Returns a Chat Formatted List of all nation residents who hold a rank.getRanksForTown(Town town, Translator translator) Returns a Chat Formatted List of all town residents who hold a rank.static StatusScreenGets the status screen of a Nation.static StatusScreenGets the status screen of a Residentstatic StatusScreenGets the status screen of a TownBlockstatic StatusScreenGets the status screen of a Town.static StatusScreengetStatus(TownyWorld world, org.bukkit.command.CommandSender sender) Gets the status screen for a World.getTaxStatus(Resident resident, Translator translator) Returns the tax info this resident will have to pay at the next new day.static StringgetTime()getTownSubtitle(Town town, TownyWorld world, Translator translator) Returns the 2nd line of the Town StatusScreen.static voidstatic voidshortenOverLengthList(List<String> list, int i, Translator translator)
-
Field Details
-
lastOnlineFormat
-
lastOnlineFormatIncludeYear
-
registeredFormat
-
fullDateFormat
-
listPrefixFormat
1 = Description 2 = Count Colours: 3 = Description and : 4 = Count 5 = Colour for the start of the list- See Also:
-
keyValueFormat
- See Also:
-
keyFormat
- See Also:
-
hoverFormat
- See Also:
-
bracketFormat
- See Also:
-
-
Constructor Details
-
TownyFormatter
public TownyFormatter()
-
-
Method Details
-
initialize
public static void initialize() -
getStatus
Gets the status screen of a TownBlock- Parameters:
townBlock- the TownBlock to checkplayer- Player who will be sent this status.- Returns:
- StatusScreen containing the results.
-
getStatus
Gets the status screen of a Resident- Parameters:
resident- the resident to check the status ofsender- The sender who executed the command.- Returns:
- StatusScreen containing the results.
-
getStatus
Gets the status screen of a Town.- Parameters:
town- the town in which to check.sender- CommandSender who will be sent the status.- Returns:
- StatusScreen containing the results.
-
getStatus
Gets the status screen of a Nation.- Parameters:
nation- the nation to check against.sender- CommandSender who will be sent the status.- Returns:
- StatusScreen containing the results.
-
getStatus
Gets the status screen for a World.- Parameters:
world- the world to check.sender- CommandSender who will be sent the status.- Returns:
- StatusScreen containing the results.
-
colourKeyValue
-
colourKey
-
colourKeyImportant
-
colourBracketElement
-
colourHoverKey
-
formatPopulationBrackets
-
getFormattedResidentRegistration
-
shortenOverLengthList
-
getTownSubtitle
Returns the 2nd line of the Town StatusScreen.- Parameters:
town- Town for which to get the StatusScreen.world- TownyWorld in which the town considers home.translator- Translator used in language selection.- Returns:
- Formatted 2nd line of the Town StatusScreen.
-
getNationSubtitle
Returns the 2nd line of the Nation StatusScreen.- Parameters:
nation- Nation for which to get the StatusScreen.translator- Translator used in language selection.- Returns:
- Formatted 2nd line of the Nation StatusScreen.
-
getExtraFields
Returns a list of MetaData used in the StatusScreens.- Parameters:
to- TownyObject for which to gather the metadata of.- Returns:
- List of visible metadata.
-
getFormattedOnlineResidents
public static String getFormattedOnlineResidents(String prefix, ResidentList residentList, org.bukkit.entity.Player player) Used in /n online and /t online.- Parameters:
prefix- String prefix to use.residentList- ResidentList representing the town or nation.player- Player which is doing the looking, used for Vanishing.- Returns:
- String of formatted residents listed and prefixed.
-
getFormattedTownyObjects
Used to prefix, count and list the given object.- Parameters:
prefix- String applied to beginning of the list.objectlist- List of TownyObjects to list.- Returns:
- Formatted, prefixed list of TownyObjects.
-
getFormattedStrings
Used to prefix, count and list the given strings.- Parameters:
prefix- String applied to beginning of the list.list- List of Strings to list.- Returns:
- Formatted, prefixed list of Strings.
-
getFormattedStrings
Used to prefix, count and list the given strings.- Parameters:
prefix- String applied to beginning of the list.list- List of Strings to list.- Returns:
- Formatted, prefixed list of Strings.
-
getFormattedTownyNames
Returns a list of names, with ColourCodes translated. If the list is under 20 long, it will use the formatted names.- Parameters:
objs- List of TownyObjects of which to make a list of names.- Returns:
- List of Names coloured, and potentially formatted.
-
getFormattedNames
Returns an Array of names, using their Formatted (long) names, with ColourCodes translated.- Parameters:
objs- Array of TownyObjects of which to make a list of names.- Returns:
- Array of Names, formatted and coloured.
-
getFormattedNames
-
getTaxStatus
Returns the tax info this resident will have to pay at the next new day.- Parameters:
resident- the resident to checktranslator- Translator to localize messaging.- Returns:
- tax status message
-
getRanksForTown
Returns a Chat Formatted List of all town residents who hold a rank.- Parameters:
town- the town for which to check against.translator- localization to use.- Returns:
- a list containing formatted rank data.
-
getRanksForNation
Returns a Chat Formatted List of all nation residents who hold a rank.- Parameters:
nation- the nation for which to check against.translator- localization to use.- Returns:
- a list containing formatted rank data.
-
getTime
- Returns:
- the Time.
-