9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2026-01-04 15:31:38 +00:00

Remove cached account

This commit is contained in:
SamB440
2020-06-26 19:49:18 +01:00
parent 38972f6361
commit c75b4d5202

View File

@@ -191,6 +191,7 @@ public class RPGRegionsCommand extends BaseCommand {
case 1: {
if (player.hasPlayedBefore()) {
plugin.getManagers().getStorageManager().clearDiscoveries(player.getUniqueId());
if (!player.isOnline()) plugin.getManagers().getStorageManager().removeCachedAccount(player.getUniqueId());
sender.sendMessage(ChatColor.GREEN + "Players discoveries has been cleared.");
} else {
sender.sendMessage(ChatColor.RED + "That player cannot be found.");
@@ -203,6 +204,7 @@ public class RPGRegionsCommand extends BaseCommand {
String regionId = args[1];
if (plugin.getManagers().getRegionsCache().getConfiguredRegions().containsKey(regionId)) {
plugin.getManagers().getStorageManager().clearDiscovery(player.getUniqueId(), regionId);
if (!player.isOnline()) plugin.getManagers().getStorageManager().removeCachedAccount(player.getUniqueId());
sender.sendMessage(ChatColor.GREEN + "Discovery cleared.");
} else {
sender.sendMessage(ChatColor.RED + "Region does not exist or is not configured.");