Class UtilManager
java.lang.Object
rocks.gravili.notquests.spigot.managers.UtilManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
getCenteredMessage
(String message) getExtraArguments
(String argumentString) getExtraArguments
(String[] args, int startAt) final org.bukkit.OfflinePlayer
getOfflinePlayer
(String playerName) final UUID
getOfflineUUID
(String playerName) Utility function: Tries to return the UUID of an offline player (can also be online) via some weird Bukkit function.final UUID
getOnlineUUID
(String playerName) Utility function: Returns the UUID of an online player.final boolean
isItemEmpty
(org.bukkit.inventory.ItemStack itemStack) listFilesRecursively
(File directory) final String
miniMessageToLegacy
(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 String
replaceLegacyWithMiniMessage
(String toReplace) void
sendFancyCommandCompletion
(net.kyori.adventure.audience.Audience audience, String[] args, String hintCurrentArg, String hintNextArgs) final String
-
Constructor Details
-
UtilManager
-
-
Method Details
-
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) -
listFilesRecursively
-
wrapText
-
replaceLegacyWithMiniMessage
-
miniMessageToLegacy
-
miniMessageToLegacyWithSpigotRGB
-