/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.mojang.brigadier.arguments.StringArgumentType
 *  com.mojang.brigadier.builder.LiteralArgumentBuilder
 *  com.mojang.brigadier.context.CommandContext
 *  net.minecraft.class_124
 *  net.minecraft.class_2172
 *  net.minecraft.class_2561
 *  net.minecraft.class_2661
 */
package meteordevelopment.meteorclient.commands.commands;

import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.class_124;
import net.minecraft.class_2172;
import net.minecraft.class_2561;
import net.minecraft.class_2661;

public class DisconnectCommand
extends Command {
    public DisconnectCommand() {
        super("disconnect", "Disconnect from the server", "dc");
    }

    @Override
    public void build(LiteralArgumentBuilder<class_2172> builder) {
        builder.executes(context -> {
            DisconnectCommand.mc.field_1724.field_3944.method_52781(new class_2661((class_2561)class_2561.method_43470((String)"%s[%sDisconnectCommand%s] Disconnected by user.".formatted(class_124.field_1080, class_124.field_1078, class_124.field_1080))));
            return 1;
        });
        builder.then(DisconnectCommand.argument("reason", StringArgumentType.greedyString()).executes(context -> {
            DisconnectCommand.mc.field_1724.field_3944.method_52781(new class_2661((class_2561)class_2561.method_43470((String)StringArgumentType.getString((CommandContext)context, (String)"reason"))));
            return 1;
        }));
    }
}

