Package com.ranull.graves.util
Class StringUtil
java.lang.Object
com.ranull.graves.util.StringUtil
Utility class for handling and formatting strings, including placeholders and color codes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormats a string by capitalizing each word and replacing underscores with spaces.static StringgetDateString(Grave grave, long time, Graves plugin) Gets the date string for a given time in a specific format.static StringgetTimeString(Grave grave, long time, Graves plugin) Gets the time string for a given duration in milliseconds.static StringparseString(String string, Graves plugin) static StringparseString(String string, Grave grave, Graves plugin) static StringparseString(String string, String name, Graves plugin) static StringparseString(String string, org.bukkit.entity.Entity entity, Graves plugin) static StringparseString(String string, org.bukkit.entity.Entity entity, String name, org.bukkit.Location location, Grave grave, Graves plugin) Parses a string and replaces placeholders with corresponding values.static StringparseString(String string, org.bukkit.entity.Entity entity, org.bukkit.Location location, Grave grave, Graves plugin) static StringparseString(String string, org.bukkit.Location location, Grave grave, Graves plugin) static StringDeprecated.This method is deprecated and will be removed in a future version.
-
Method Details
-
format
Formats a string by capitalizing each word and replacing underscores with spaces.- Parameters:
string- The string to format.- Returns:
- The formatted string.
-
parseString
-
parseString
-
parseString
-
parseString
-
parseString
-
parseString
-
parseString
public static String parseString(String string, org.bukkit.entity.Entity entity, String name, org.bukkit.Location location, Grave grave, Graves plugin) Parses a string and replaces placeholders with corresponding values.- Parameters:
string- The string to parse.entity- The entity involved.name- The name to replace in the string.location- The location to replace in the string.grave- The grave object to replace in the string.plugin- The plugin instance.- Returns:
- The parsed string with placeholders replaced.
-
parseTime
Deprecated.This method is deprecated and will be removed in a future version. UsegetDateString(Grave, long, Graves)instead.- Parameters:
string- The string to parse.grave- The grave object.- Returns:
- The parsed string with time placeholders replaced.
-
getDateString
Gets the date string for a given time in a specific format.- Parameters:
grave- The grave object.time- The time in milliseconds.plugin- The plugin instance.- Returns:
- The formatted date string.
-
getTimeString
Gets the time string for a given duration in milliseconds.- Parameters:
grave- The grave object.time- The time in milliseconds.plugin- The plugin instance.- Returns:
- The formatted time string.
-