package dev.crucifixbeta.mod.commands.impl;

import dev.crucifixbeta.CrucifixBeta;
import dev.crucifixbeta.core.impl.ConfigManager;
import dev.crucifixbeta.mod.commands.Command;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.CLIENT)
public class SaveCommand extends Command {

   public SaveCommand() {
      super("save", "");
   }

   @Override
   public void runCommand(String[] parameters) {
      if (parameters.length == 1) {
         this.sendChatMessage("§fSaving config named " + parameters[0]);
         ConfigManager.saveCfg(parameters[0]);
      } else {
         this.sendChatMessage("\u00a7fSaving..");
      }

      CrucifixBeta.save();
   }

   @Override
   public String[] getAutocorrect(int count, List<String> seperated) {
      return null;
   }
}
