Rendering cleanup

Replaces the reflexive instantiation of the Renderes with a factory
method.

Some optimizations to the renderers to no longer push the whole OpenGL state to the stack.

General cleanup of duplicate code, etc
This commit is contained in:
yueh
2015-09-16 18:03:07 +02:00
parent 824ec1eccb
commit d5dfc31210
69 changed files with 435 additions and 343 deletions
@@ -45,6 +45,7 @@ public class ItemEncodedPatternRenderer implements IItemRenderer
if( !this.recursive && type == IItemRenderer.ItemRenderType.INVENTORY && isShiftHeld )
{
final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
if( iep.getOutput( item ) != null )
{
return true;
@@ -66,11 +67,10 @@ public class ItemEncodedPatternRenderer implements IItemRenderer
this.recursive = true;
final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
final ItemStack is = iep.getOutput( item );
final Minecraft mc = Minecraft.getMinecraft();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glPushAttrib( GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT );
RenderHelper.enableGUIStandardItemLighting();
this.ri.renderItemAndEffectIntoGUI( mc.fontRenderer, mc.getTextureManager(), is, 0, 0 );
RenderHelper.disableStandardItemLighting();