public class FormatUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
cutDecimals(double d)
Remove extra decimals from the end of the double.
|
static String |
formatLocation(org.bukkit.Location loc)
Formats a Minecraft Location into readable format.
|
static String |
formatTimeAmount(long ms)
Format time amount according to the config settings.
|
static String |
formatTimeAmountDifference(long before,
long after)
Format the time difference between an end point and a start point.
|
static String |
formatTimeStamp(long epochMs) |
static String |
formatTimeStampSecond(long epochMs) |
static String |
formatTimeStampYear(long epochMs) |
static String[] |
mergeArrays(String[]... arrays)
Merges multiple arrays into one.
|
static int |
parseVersionNumber(String versionString)
Turns the version string into a integer
|
static String |
removeLetters(String dataPoint)
Removes letters from a string leaving only numbers and dots.
|
static String |
removeNumbers(String dataPoint)
Removes numbers from a string leaving only letters.
|
public static String formatTimeAmount(long ms)
ms
- Milliseconds.public static String formatTimeAmountDifference(long before, long after)
before
- Epoch ms.after
- Epoch ms.public static String formatTimeStamp(long epochMs)
public static String formatTimeStampSecond(long epochMs)
public static String formatTimeStampYear(long epochMs)
public static String removeLetters(String dataPoint)
dataPoint
- String to remove stuff from.public static String removeNumbers(String dataPoint)
dataPoint
- String to remove stuff from.public static int parseVersionNumber(String versionString)
versionString
- String - number format 1.1.1NumberFormatException
- When wrong formatpublic static String[] mergeArrays(String[]... arrays)
arrays
- String arrays that need to be combinedpublic static String formatLocation(org.bukkit.Location loc)
loc
- Location to formatpublic static String cutDecimals(double d)
d
- Double.Copyright © 2017. All rights reserved.