Class UtilManager

java.lang.Object
rocks.gravili.notquests.paper.managers.UtilManager

public class UtilManager extends Object
  • Constructor Details

    • UtilManager

      public UtilManager(NotQuests main)
  • Method Details

    • getMiniMessageTokens

      public final ArrayList<String> getMiniMessageTokens()
    • getOnlineUUID

      public final UUID getOnlineUUID(String playerName)
      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

      public 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. 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

      public final org.bukkit.OfflinePlayer getOfflinePlayer(String playerName)
    • replaceFromMap

      public String 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.

      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, since String.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

      public void sendFancyCommandCompletion(org.bukkit.command.CommandSender sender, String[] args, String hintCurrentArg, String hintNextArgs)
    • getExtraArguments

      public final HashMap<String,String> getExtraArguments(String argumentString)
    • getExtraArguments

      public final HashMap<String,String> getExtraArguments(String[] args, int startAt)
    • getCenteredMessage

      public final String getCenteredMessage(String message)
    • isItemEmpty

      public final boolean isItemEmpty(org.bukkit.inventory.ItemStack itemStack)
    • listFiles

      public List<File> listFiles(File directory)
    • listFilesRecursively

      public List<File> listFilesRecursively(File directory)
    • listFoldersWithoutLanguagesOrBackups

      public List<File> listFoldersWithoutLanguagesOrBackups(File directory)
    • listFoldersRecursivelyWithoutLanguagesOrBackups

      public List<File> listFoldersRecursivelyWithoutLanguagesOrBackups(File directory)
    • listFoldersRecursively

      public List<File> listFoldersRecursively(File directory)
    • wrapText

      public final String wrapText(String unwrappedText, int maxLineLength)
    • replaceLegacyWithMiniMessage

      public final String replaceLegacyWithMiniMessage(String toReplace)
    • miniMessageToLegacy

      public final String miniMessageToLegacy(String miniMessageString)
    • miniMessageToLegacyWithSpigotRGB

      public String miniMessageToLegacyWithSpigotRGB(String miniMessageString)
    • applyPlaceholders

      public final String applyPlaceholders(String message, Object... objects)