/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  meteordevelopment.orbit.ICancellable
 *  net.minecraft.class_4587$class_4665
 *  net.minecraft.class_804
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.injection.At
 *  org.spongepowered.asm.mixin.injection.Inject
 *  org.spongepowered.asm.mixin.injection.callback.CallbackInfo
 */
package meteordevelopment.meteorclient.mixin;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.render.ApplyTransformationEvent;
import meteordevelopment.orbit.ICancellable;
import net.minecraft.class_4587;
import net.minecraft.class_804;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value={class_804.class})
public abstract class TransformationMixin {
    @Inject(method={"method_23075"}, at={@At(value="HEAD")}, cancellable=true)
    private void onApply(boolean leftHanded, class_4587.class_4665 entry, CallbackInfo info) {
        ApplyTransformationEvent event = (ApplyTransformationEvent)MeteorClient.EVENT_BUS.post((ICancellable)ApplyTransformationEvent.get((class_804)this, leftHanded));
        if (event.isCancelled()) {
            info.cancel();
        }
    }
}

