mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 21:24:43 +02:00
Use Long.parseLong because we have a use for the catch
This commit is contained in:
@ -122,13 +122,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
String[] character = line.split(":");
|
String[] character = line.split(":");
|
||||||
String name = character[0];
|
String name = character[0];
|
||||||
long lastPlayed = StringUtils.getLong(character[37]) * Misc.TIME_CONVERSION_FACTOR;
|
long lastPlayed;
|
||||||
boolean rewrite = false;
|
boolean rewrite = false;
|
||||||
|
try {
|
||||||
if (lastPlayed == 0) {
|
lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR;
|
||||||
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
} catch (NumberFormatException e) {
|
||||||
lastPlayed = player.getLastPlayed();
|
|
||||||
rewrite = true;
|
rewrite = true;
|
||||||
|
lastPlayed = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentTime - lastPlayed > PURGE_TIME) {
|
if (currentTime - lastPlayed > PURGE_TIME) {
|
||||||
|
Reference in New Issue
Block a user