/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  meteordevelopment.orbit.ICancellable
 *  net.minecraft.class_11659
 *  net.minecraft.class_11954
 *  net.minecraft.class_12075
 *  net.minecraft.class_4587
 *  net.minecraft.class_824
 *  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.RenderBlockEntityEvent;
import meteordevelopment.orbit.ICancellable;
import net.minecraft.class_11659;
import net.minecraft.class_11954;
import net.minecraft.class_12075;
import net.minecraft.class_4587;
import net.minecraft.class_824;
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_824.class})
public abstract class BlockEntityRenderManagerMixin {
    @Inject(method={"method_3555"}, at={@At(value="HEAD")}, cancellable=true)
    private <S extends class_11954> void onRenderEntity(S renderState, class_4587 matrices, class_11659 queue, class_12075 arg, CallbackInfo ci) {
        RenderBlockEntityEvent event = (RenderBlockEntityEvent)MeteorClient.EVENT_BUS.post((ICancellable)RenderBlockEntityEvent.get(renderState));
        if (event.isCancelled()) {
            ci.cancel();
        }
    }
}

