package codechicken.enderstorage.client.render.item;

import codechicken.enderstorage.api.Frequency;
import codechicken.enderstorage.client.render.tile.RenderTileEnderTank;
import codechicken.enderstorage.network.TankSynchroniser;
import codechicken.lib.render.IItemRenderer;
import codechicken.lib.render.RenderUtils;
import codechicken.lib.render.TransformUtils;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.tuple.Pair;

import javax.vecmath.Matrix4f;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by covers1624 on 4/27/2016.
 */
public class EnderTankItemRender implements IItemRenderer, IPerspectiveAwareModel {
    @Override
    public void renderItem(ItemStack item) {
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.pushMatrix();
        Frequency frequency = Frequency.fromItemStack(item);
        FluidStack fluidStack = TankSynchroniser.getClientLiquid(frequency);
        RenderTileEnderTank.renderTank(2, 0F, frequency, 0, 0, 0, 0);
        if (fluidStack != null && RenderUtils.shouldRenderFluid(fluidStack)) {
            RenderTileEnderTank.renderLiquid(fluidStack, 0, 0, 0);
        }

        GlStateManager.popMatrix();
        RenderHelper.enableGUIStandardItemLighting();
    }

    @Override
    public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
        return new ArrayList<BakedQuad>();
    }

    @Override
    public boolean isAmbientOcclusion() {
        return false;
    }

    @Override
    public boolean isGui3d() {
        return false;
    }

    @Override
    public boolean isBuiltInRenderer() {
        return true;
    }

    @Override
    public TextureAtlasSprite getParticleTexture() {
        return null;
    }

    @Override
    public ItemCameraTransforms getItemCameraTransforms() {
        return ItemCameraTransforms.DEFAULT;
    }

    @Override
    public ItemOverrideList getOverrides() {
        return ItemOverrideList.NONE;
    }

    @Override
    public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
        return MapWrapper.handlePerspective(this, TransformUtils.DEFAULT_BLOCK.getTransforms(), cameraTransformType);
    }
}

@@ -1338,62 +1338,8 @@
 ) %7B%0A
-        RenderHelper.enableGUIStandardItemLighting();%0A
     
@@ -1776,62 +1776,8 @@
 ();%0A
-        RenderHelper.enableGUIStandardItemLighting();%0A
     

Remove some incorrect lighting calls, still some lighting artifacts with tanks bu not on other blocks.