package de.viper.survivalplus.commands;

import de.viper.survivalplus.SurvivalPlus;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.configuration.file.FileConfiguration;

public class DayCommand implements CommandExecutor {
    private final SurvivalPlus plugin;

    public DayCommand(SurvivalPlus plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("§cNur Spieler können diesen Befehl ausführen!");
            return true;
        }

        if (!player.hasPermission("survivalplus.day")) {
            player.sendMessage(plugin.getLangConfig().getString("no-permission", "§cDu hast keine Berechtigung!"));
            return true;
        }

        player.getWorld().setTime(1000); // Tag setzen
        player.sendMessage("§aEs ist jetzt Tag!");
        return true;
    }
}
