2013-12-27 23:59:59 +01:00
|
|
|
package appeng.client.render;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.client.IItemRenderer;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
|
|
public class ItemRenderer implements IItemRenderer
|
|
|
|
{
|
|
|
|
|
|
|
|
public static final ItemRenderer instance = new ItemRenderer();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
|
|
|
{
|
|
|
|
GL11.glPushMatrix();
|
2014-02-09 02:34:52 +01:00
|
|
|
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
|
|
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
|
|
|
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
|
|
|
GL11.glEnable( GL11.GL_BLEND );
|
|
|
|
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
if ( type == ItemRenderType.ENTITY )
|
|
|
|
GL11.glTranslatef( -0.5f, -0.5f, -0.5f );
|
|
|
|
if ( type == ItemRenderType.INVENTORY )
|
|
|
|
GL11.glTranslatef( 0.0f, -0.1f, 0.0f );
|
|
|
|
WorldRender.instance.renderItemBlock( item );
|
2014-02-09 02:34:52 +01:00
|
|
|
|
|
|
|
GL11.glPopAttrib();
|
2013-12-27 23:59:59 +01:00
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|