Class UtilManager
java.lang.Object
rocks.gravili.notquests.paper.managers.UtilManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringapplyPlaceholders(String message, Object... objects) final StringgetCenteredMessage(String message) getExtraArguments(String argumentString) getExtraArguments(String[] args, int startAt) final org.bukkit.OfflinePlayergetOfflinePlayer(String playerName) final UUIDgetOfflineUUID(String playerName) Utility function: Tries to return the UUID of an offline player (can also be online) via some weird Bukkit function.final UUIDgetOnlineUUID(String playerName) Utility function: Returns the UUID of an online player.final booleanisItemEmpty(org.bukkit.inventory.ItemStack itemStack) listFilesRecursively(File directory) listFoldersRecursively(File directory) listFoldersWithoutLanguagesOrBackups(File directory) final StringminiMessageToLegacy(String miniMessageString) miniMessageToLegacyWithSpigotRGB(String miniMessageString) replaceFromMap(String string, Map<String, String> replacements) Replaces all occurrences of keys of the given map in the given string with the associated value in that map.final StringreplaceLegacyWithMiniMessage(String toReplace) voidsendFancyCommandCompletion(org.bukkit.command.CommandSender sender, String[] args, String hintCurrentArg, String hintNextArgs) final String
-
Constructor Details
-
UtilManager
-
-
Method Details
-
getMiniMessageTokens
-
getOnlineUUID
Utility function: Returns the UUID of an online player. If the player is offline, it will return null.- Parameters:
playerName- the name of the online player you want to get the UUID from- Returns:
- the UUID of the specified, online player
-
getOfflineUUID
Utility function: Tries to return the UUID of an offline player (can also be online) via some weird Bukkit function. This probably makes calls to the Minecraft API, I don't know for sure. It's definitely slower.- Parameters:
playerName- the name of the player you want to get the UUID from- Returns:
- the UUID from the player based on his current username.
-
getOfflinePlayer
-
replaceFromMap
Replaces all occurrences of keys of the given map in the given string with the associated value in that map.This method is semantically the same as calling
String.replace(CharSequence, CharSequence)for each of the entries in the map, but may be significantly faster for many replacements performed on a short string, sinceString.replace(CharSequence, CharSequence)uses regular expressions internally and results in many String object allocations when applied iteratively.The order in which replacements are applied depends on the order of the map's entry set.
-
sendFancyCommandCompletion
-
getExtraArguments
-
getExtraArguments
-
getCenteredMessage
-
isItemEmpty
public final boolean isItemEmpty(org.bukkit.inventory.ItemStack itemStack) -
listFiles
-
listFilesRecursively
-
listFoldersWithoutLanguagesOrBackups
-
listFoldersRecursivelyWithoutLanguagesOrBackups
-
listFoldersRecursively
-
wrapText
-
replaceLegacyWithMiniMessage
-
miniMessageToLegacy
-
miniMessageToLegacyWithSpigotRGB
-
applyPlaceholders
-