1
0
This commit is contained in:
Lee
2024-03-29 17:46:05 +00:00
parent f9268f8bd4
commit 641e40b35d
13 changed files with 485 additions and 37 deletions

View File

@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
@Log4j2
public class AccountManager extends Manager {
private final int SAVE_INTERVAL = 60 * 5; // 5 minutes
private final long SAVE_INTERVAL = 5; // in minutes
private static final Map<UUID, Account> ACCOUNTS = new HashMap<>();
public AccountManager() {
@ -28,7 +28,7 @@ public class AccountManager extends Manager {
Bukkit.getAsyncScheduler().runAtFixedRate(Aetheria.INSTANCE, (task) -> {
this.saveAccounts();
}, SAVE_INTERVAL, SAVE_INTERVAL, TimeUnit.SECONDS);
}, SAVE_INTERVAL, SAVE_INTERVAL, TimeUnit.MINUTES);
}
/**
@ -99,6 +99,7 @@ public class AccountManager extends Manager {
return;
}
this.saveAccounts();
this.saveAccounts(); // Save the accounts to disk
ACCOUNTS.clear(); // Remove the accounts from the cache
}
}