/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_1297
 *  net.minecraft.class_2824
 *  net.minecraft.class_2824$class_5906
 *  net.minecraft.class_2824$class_5907
 *  org.spongepowered.asm.mixin.Final
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.Shadow
 *  org.spongepowered.asm.mixin.injection.At
 *  org.spongepowered.asm.mixin.injection.ModifyVariable
 */
package meteordevelopment.meteorclient.mixin;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.mixininterface.IPlayerInteractEntityC2SPacket;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.movement.NoSlow;
import meteordevelopment.meteorclient.systems.modules.movement.Sneak;
import net.minecraft.class_1297;
import net.minecraft.class_2824;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Mixin(value={class_2824.class})
public abstract class PlayerInteractEntityC2SPacketMixin
implements IPlayerInteractEntityC2SPacket {
    @Shadow
    @Final
    private class_2824.class_5906 field_12871;
    @Shadow
    @Final
    private int field_12870;

    @Override
    public class_2824.class_5907 meteor$getType() {
        return this.field_12871.method_34211();
    }

    @Override
    public class_1297 meteor$getEntity() {
        return MeteorClient.mc.field_1687.method_8469(this.field_12870);
    }

    @ModifyVariable(method={"<init>(IZLnet/minecraft/class_2824$class_5906;)V"}, at=@At(value="HEAD"), ordinal=0, argsOnly=true)
    private static boolean setSneaking(boolean sneaking) {
        return Modules.get().get(Sneak.class).doPacket() || Modules.get().get(NoSlow.class).airStrict() || sneaking;
    }
}

