package dev.crucifixbeta.mod.commands.impl;

import dev.crucifixbeta.mod.commands.Command;
import dev.crucifixbeta.mod.modules.impl.client.ClientSetting;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

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

   public PrefixCommand() {
      super("prefix", "[prefix]");
   }

   @Override
   public void runCommand(String[] parameters) {
      if (parameters.length == 0) {
         this.sendUsage();
      } else if (parameters[0].startsWith("/")) {
         this.sendChatMessage("\u00a7fPlease specify keyCodec valid \u00a7bprefix.");
      } else {
         ClientSetting.INSTANCE.prefix.setValue(parameters[0]);
         this.sendChatMessage("§bPrefix §fset to §e" + parameters[0]);
      }
   }

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