- Renamed JsonCache to PlayerDataStorage

* the methods inside it renamed to fit with class name
  * cache folder changed into playerdata
- Renamed LimboPlayer to PlayerData
- Added fly speed to PlayerData
- Removed player's name from PlayerData object
- Added getPlayerLocationOrSpawn method in spawn loader.
This commit is contained in:
DNx5
2016-07-03 21:52:46 +07:00
parent 7ea0763966
commit deffcb3e2b
26 changed files with 554 additions and 220 deletions
@@ -72,7 +72,16 @@ public final class Utils {
}
}
/**
* Get player's UUID if can, name otherwise.
*
* @param player Player to retrieve
*
* @return player's UUID or Name in String.
*/
public static String getUUIDorName(OfflinePlayer player) {
// We may made this configurable in future
// so we can have uuid support.
try {
return player.getUniqueId().toString();
} catch (Exception ignore) {
@@ -80,6 +89,13 @@ public final class Utils {
}
}
/**
* Compile Pattern sneaky without throwing Exception.
*
* @param pattern pattern string to compile
*
* @return the given regex compiled into Pattern object.
*/
public static Pattern safePatternCompile(String pattern) {
try {
return Pattern.compile(pattern);