package com.newhive.scammerradar.commands;

import com.newhive.scammerradar.ScammerRadarAddon;
import com.newhive.scammerradar.commands.subcommands.AddSubCommand;
import com.newhive.scammerradar.commands.subcommands.CheckSubCommand;
import com.newhive.scammerradar.commands.subcommands.EditSubCommand;
import com.newhive.scammerradar.commands.subcommands.RemoveSubCommand;
import com.newhive.scammerradar.commands.subcommands.ShowSubCommand;
import com.newhive.scammerradar.commands.subcommands.UpdateSubCommand;
import com.newhive.scammerradar.config.ScammerRadarConfig;
import net.labymod.api.client.chat.command.Command;
import net.labymod.api.client.component.TextComponent;
import net.labymod.api.client.component.format.TextColor;
import net.labymod.api.util.I18n;

public class ScammerCommand extends Command {
   private final ScammerRadarAddon addon;

   public ScammerCommand(ScammerRadarAddon addon) {
      super("scammer", new String[]{"sr"});
      this.addon = addon;
      this.withSubCommand(new AddSubCommand(this.addon));
      this.withSubCommand(new RemoveSubCommand(this.addon));
      this.withSubCommand(new EditSubCommand(this.addon));
      this.withSubCommand(new CheckSubCommand(this.addon));
      this.withSubCommand(new UpdateSubCommand(this.addon));
      this.withSubCommand(new ShowSubCommand(this.addon));
   }

   public boolean execute(String prefix, String[] arguments) {
      if (!(Boolean)((ScammerRadarConfig)this.addon.configuration()).enabled().get()) {
         return false;
      } else {
         this.addon.getHelper().displayNotification(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.help.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.help.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.add.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.add.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.remove.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.remove.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.edit.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.edit.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.show.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.show.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.check.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.check.help", new Object[0]))).append(System.lineSeparator())).color(TextColor.color(255, 255, 255))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(I18n.translate("scammerradar.commands.update.syntax", new Object[0]))).color(TextColor.color(255, 191, 0))).build())).append(((TextComponent.Builder)((TextComponent.Builder)TextComponent.builder().append(" | " + I18n.translate("scammerradar.commands.update.help", new Object[0]))).color(TextColor.color(255, 255, 255))).build())).build());
         return true;
      }
   }
}
