package com.zivilon.cinder_loe.mixins;

import com.zivilon.cinder_loe.client.render.item.RenderHelper;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import lotr.client.render.item.LOTRRenderLargeItem;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.IResource;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;

import net.minecraftforge.client.IItemRenderer;

import java.io.IOException;
import java.util.Map;

@Mixin(LOTRRenderLargeItem.class)
public abstract class MixinLOTRRenderLargeItem {

    /**
    * @author Shinare
    * @reason Added support for transparent textures
    */
	@Redirect(method = "renderLargeItem(Lnet/minecraft/util/IIcon;)V", remap = false,
              at = @At(value = "INVOKE",
                       target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V"))
    private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) {
        RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false);
    }
}
