Class ChatUtils
java.lang.Object
io.github.thebusybiscuit.slimefun4.utils.ChatUtils
This utility class contains a few static methods that are all about
String manipulation
or sending a String to a Player.- Author:
- TheBusyBiscuit
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidawaitInput(Player p, Consumer<String> callback) static StringcheckPlurality(String string, int count) This method adds an s to a string if the supplied integer is not 1.static Stringstatic Stringstatic StringThis converts a givenStringto a human-friendly version.static StringremoveColorCodes(String string) static voidsendURL(CommandSender sender, String url)
-
Method Details
-
sendURL
-
removeColorCodes
-
crop
-
christmas
-
awaitInput
-
humanize
This converts a givenStringto a human-friendly version. This can be used to convert enum constants to easier to read words with spaces and upper case word starts. For example:ENUM_CONSTANT: Enum Constant -
checkPlurality
This method adds an s to a string if the supplied integer is not 1.- Parameters:
string- The string to potentially pluralizecount- The amount of things- Returns:
stringifcountis 1 elsestring + "s"- Throws:
IllegalArgumentException- if count is less than 0
-