package fr.xephi.authme.command.executable.authme;

import fr.xephi.authme.command.PlayerCommand;
import fr.xephi.authme.settings.SpawnLoader;
import org.bukkit.entity.Player;

import javax.inject.Inject;
import java.util.List;

public class SetFirstSpawnCommand extends PlayerCommand {

    @Inject
    private SpawnLoader spawnLoader;

    @Override
    public void runCommand(Player player, List<String> arguments) {
        if (spawnLoader.setFirstSpawn(player.getLocation())) {
            player.sendMessage("[AuthMe] Correctly defined new first spawn point");
        } else {
            player.sendMessage("[AuthMe] SetFirstSpawn has failed, please retry");
        }
    }
}
