Minor optimizations to expire manager

#469
This commit is contained in:
boy0001
2015-08-08 02:09:55 +10:00
parent ef59c833e3
commit b88c6d8d26
3 changed files with 52 additions and 3 deletions

View File

@ -188,7 +188,13 @@ public class ExpireManager {
last = dates.get(uuid);
}
else {
final OfflinePlayer op = Bukkit.getOfflinePlayer(name);
OfflinePlayer op;
if (Settings.TWIN_MODE_UUID) {
op = Bukkit.getOfflinePlayer(uuid);
}
else {
op = Bukkit.getOfflinePlayer(name);
}
if (op.hasPlayedBefore()) {
last = op.getLastPlayed();
dates.put(uuid, last);

View File

@ -174,11 +174,13 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
if (getUUIDMap().size() == 0) {
for (OfflinePlotPlayer op : uuidWrapper.getOfflinePlayers()) {
if (op.getLastPlayed() != 0) {
long last = op.getLastPlayed();
if (last != 0) {
String name = op.getName();
StringWrapper wrap = new StringWrapper(name);
UUID uuid = uuidWrapper.getUUID(op);
toAdd.put(wrap, uuid);
ExpireManager.dates.put(uuid, last);
}
}
}