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 String
Formats a string by capitalizing each word and replacing underscores with spaces.static String
getDateString
(Grave grave, long time, Graves plugin) Gets the date string for a given time in a specific format.static String
getTimeString
(Grave grave, long time, Graves plugin) Gets the time string for a given duration in milliseconds.static String
parseString
(String string, Graves plugin) static String
parseString
(String string, Grave grave, Graves plugin) static String
parseString
(String string, String name, Graves plugin) static String
parseString
(String string, org.bukkit.entity.Entity entity, Graves plugin) 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.static String
parseString
(String string, org.bukkit.entity.Entity entity, org.bukkit.Location location, Grave grave, Graves plugin) static String
parseString
(String string, org.bukkit.Location location, Grave grave, Graves plugin) static String
Deprecated.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.
-