package dev.crucifixbeta.mod.commands.impl;

import dev.crucifixbeta.mod.commands.Command;
import dev.crucifixbeta.mod.features.DebugFeatures;
import dev.crucifixbeta.mod.gui.clickgui.ClickGuiScreen;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

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

   public DebugCommand() {
      super("debug", "[open]");
   }

   @Override
   public void runCommand(String[] parameters) {
      if (parameters.length != 0 && parameters[0].equalsIgnoreCase("open")) {
         DebugFeatures.setDebugGuiOpen(true);
         ClickGuiScreen.getInstance().reload();
         this.sendChatMessage("\u00a7a\u5f00\u542f\u6210\u529f");
      } else {
         this.sendUsage();
      }
   }

   @Override
   public String[] getAutocorrect(int count, List<String> separated) {
      return count == 1 ? new String[]{"open"} : null;
   }
}
