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

import com.mojang.brigadier.arguments.DoubleArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.class_1297;
import net.minecraft.class_2172;
import net.minecraft.class_243;

public class HClipCommand
extends Command {
    public HClipCommand() {
        super("hclip", "Lets you clip through blocks horizontally.", new String[0]);
    }

    @Override
    public void build(LiteralArgumentBuilder<class_2172> builder) {
        builder.then(HClipCommand.argument("blocks", DoubleArgumentType.doubleArg()).executes(context -> {
            double blocks = (Double)context.getArgument("blocks", Double.class);
            class_243 forward = class_243.method_1030((float)0.0f, (float)HClipCommand.mc.field_1724.method_36454()).method_1029();
            if (HClipCommand.mc.field_1724.method_5765()) {
                class_1297 vehicle = HClipCommand.mc.field_1724.method_5854();
                vehicle.method_5814(vehicle.method_23317() + forward.field_1352 * blocks, vehicle.method_23318(), vehicle.method_23321() + forward.field_1350 * blocks);
            }
            HClipCommand.mc.field_1724.method_5814(HClipCommand.mc.field_1724.method_23317() + forward.field_1352 * blocks, HClipCommand.mc.field_1724.method_23318(), HClipCommand.mc.field_1724.method_23321() + forward.field_1350 * blocks);
            return 1;
        }));
    }
}

