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