mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-02 01:46: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[] 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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user