Class ResidentUtil
java.lang.Object
com.palmergames.bukkit.towny.utils.ResidentUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Residentstatic org.bukkit.inventory.InventorygetBlankPage(String name) getOnlineResidentsViewable(org.bukkit.entity.Player viewer, ResidentList residentList) Return a list of Residents that can be seen (not vanished) by the viewer.getValidatedResidents(org.bukkit.command.CommandSender sender, List<String> names) Transforms a String[] of names to a list of Residents.getValidatedResidentsOfTown(org.bukkit.command.CommandSender sender, Town town, String[] names) Transforms a String[] of names to a list of Residents.static Stringstatic voidopenGUIInventory(Resident resident, Collection<org.bukkit.Material> set, String name) static voidopenGUIInventory(Resident resident, List<String> list, String name) Opens a basic inventory GUI with pagination.static voidopenSelectionGUI(Resident resident, SelectionGUI.SelectionType selectionType) static voidoutlawEnteredTown(Resident outlaw, Town town, org.bukkit.Location location) Method which will teleport an outlaw out of a town, if the player does not have the bypass node and the outlaw teleport feature is active.static voidMethod to remove the newest residents in order to bring a town's population low enough to meet the population cap.static voidtoggleResidentBorderTitles(Resident resident, Optional<Boolean> choice)
-
Constructor Details
-
ResidentUtil
public ResidentUtil()
-
-
Method Details
-
getOnlineResidentsViewable
public static List<Resident> getOnlineResidentsViewable(org.bukkit.entity.Player viewer, ResidentList residentList) Return a list of Residents that can be seen (not vanished) by the viewer.- Parameters:
viewer- - Player who is looking.residentList- - List of Residents which could be viewed.- Returns:
- - List of residents that can actually be seen.
-
getValidatedResidents
public static List<Resident> getValidatedResidents(org.bukkit.command.CommandSender sender, List<String> names) Transforms a String[] of names to a list of Residents. Uses the BukkitTools.matchPlayer() rather than BukkitTools.getPlayerExact(); Used for: - Inviting- Parameters:
sender- - CommandSender.names- - Names to be converted.- Returns:
- - List of residents to be used later.
-
getValidatedResidentsOfTown
public static List<Resident> getValidatedResidentsOfTown(org.bukkit.command.CommandSender sender, Town town, String[] names) Transforms a String[] of names to a list of Residents. Uses a town's resident list to validate names. Used for: - Kicking- Parameters:
sender- CommandSender who would see feedback.town- Town which is being searched.names- Names to be converted.- Returns:
- List of Residents to be used later.
-
openGUIInventory
Opens a basic inventory GUI with pagination. GUI displays either switch or itemuse materials via an ArrayList of strings is converted to valid Materials and sent to be shown to the player.- Parameters:
resident- TheResidentto show the inventory tolist- ArrayList of strings that will be converted to valid Materials.name- Name of the inventory window.
-
openGUIInventory
public static void openGUIInventory(Resident resident, Collection<org.bukkit.Material> set, String name) -
openSelectionGUI
-
getBlankPage
-
createAndGetNPCResident
-
nextNpcName
- Throws:
TownyException
-
reduceResidentCountToFitTownMaxPop
Method to remove the newest residents in order to bring a town's population low enough to meet the population cap.- Parameters:
town- The Town to reduce the population of.
-
outlawEnteredTown
Method which will teleport an outlaw out of a town, if the player does not have the bypass node and the outlaw teleport feature is active.- Parameters:
outlaw- Resident which is outlawed.town- Town where the resident is outlawed.location- Location which the player is at.
-
toggleResidentBorderTitles
-