Applied-Energistics-2-tiler.../client/render/ItemRenderer.java
AlgorithmX2 929efa5597 Added 4 View Cell Slots.
Multiple View Cells now sum together to allow more customization.
View Cells are now protected by Build Security.
Meteorite Compass now renders correctly in other peoples hands.
2014-03-04 21:12:23 -06:00

47 lines
1.2 KiB
Java

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();
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.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
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, type, data );
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}