/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.mojang.brigadier.arguments.FloatArgumentType
 *  com.mojang.brigadier.builder.LiteralArgumentBuilder
 *  com.mojang.brigadier.builder.RequiredArgumentBuilder
 *  net.minecraft.class_2172
 *  net.minecraft.class_2350
 *  net.minecraft.class_3532
 */
package meteordevelopment.meteorclient.commands.commands;

import com.mojang.brigadier.arguments.FloatArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.commands.arguments.DirectionArgumentType;
import net.minecraft.class_2172;
import net.minecraft.class_2350;
import net.minecraft.class_3532;

public class RotationCommand
extends Command {
    public RotationCommand() {
        super("rotation", "Modifies your rotation.", new String[0]);
    }

    @Override
    public void build(LiteralArgumentBuilder<class_2172> builder) {
        ((LiteralArgumentBuilder)builder.then(((LiteralArgumentBuilder)RotationCommand.literal("set").then(RotationCommand.argument("direction", DirectionArgumentType.create()).executes(context -> {
            RotationCommand.mc.field_1724.method_36457((float)(((class_2350)context.getArgument("direction", class_2350.class)).method_62675().method_10264() * -90));
            RotationCommand.mc.field_1724.method_36456(((class_2350)context.getArgument("direction", class_2350.class)).method_10144());
            return 1;
        }))).then(((RequiredArgumentBuilder)RotationCommand.argument("pitch", FloatArgumentType.floatArg((float)-90.0f, (float)90.0f)).executes(context -> {
            RotationCommand.mc.field_1724.method_36457(((Float)context.getArgument("pitch", Float.class)).floatValue());
            return 1;
        })).then(RotationCommand.argument("yaw", FloatArgumentType.floatArg((float)-180.0f, (float)180.0f)).executes(context -> {
            RotationCommand.mc.field_1724.method_36457(((Float)context.getArgument("pitch", Float.class)).floatValue());
            RotationCommand.mc.field_1724.method_36456(((Float)context.getArgument("yaw", Float.class)).floatValue());
            return 1;
        }))))).then(RotationCommand.literal("add").then(((RequiredArgumentBuilder)RotationCommand.argument("pitch", FloatArgumentType.floatArg((float)-90.0f, (float)90.0f)).executes(context -> {
            float pitch = RotationCommand.mc.field_1724.method_36455() + ((Float)context.getArgument("pitch", Float.class)).floatValue();
            RotationCommand.mc.field_1724.method_36457(pitch >= 0.0f ? Math.min(pitch, 90.0f) : Math.max(pitch, -90.0f));
            return 1;
        })).then(RotationCommand.argument("yaw", FloatArgumentType.floatArg((float)-180.0f, (float)180.0f)).executes(context -> {
            float pitch = RotationCommand.mc.field_1724.method_36455() + ((Float)context.getArgument("pitch", Float.class)).floatValue();
            RotationCommand.mc.field_1724.method_36457(pitch >= 0.0f ? Math.min(pitch, 90.0f) : Math.max(pitch, -90.0f));
            float yaw = RotationCommand.mc.field_1724.method_36454() + ((Float)context.getArgument("yaw", Float.class)).floatValue();
            RotationCommand.mc.field_1724.method_36456(class_3532.method_15393((float)yaw));
            return 1;
        }))));
    }
}

