stuff
This commit is contained in:
@ -14,6 +14,7 @@ import cc.fascinated.utils.Style;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -106,6 +107,20 @@ public class AccountManager extends Manager implements Listener {
|
||||
log.info("Saved {}/{} accounts. ({}ms)", saved, ACCOUNTS.size(), System.currentTimeMillis() - before);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an account from the server.
|
||||
* This will remove the account from memory and delete the account file.
|
||||
*
|
||||
* @param account the account to delete
|
||||
*/
|
||||
public void deleteAccount(Account account) {
|
||||
account.getFile().delete();
|
||||
ACCOUNTS.remove(account.getUuid());
|
||||
|
||||
account.getPlayer().kick(Component.text("Your account has been deleted. Please reconnect."));
|
||||
log.info("Deleted account for {}", account.getUuid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Priority getPriority() {
|
||||
return Priority.LOWEST;
|
||||
|
Reference in New Issue
Block a user