Cache Lighting Data.

This commit is contained in:
AlgorithmX2 2014-02-15 00:30:06 -06:00
parent ae35411d33
commit 644217baf5
15 changed files with 236 additions and 100 deletions

View file

@ -11,6 +11,7 @@ import appeng.api.AEApi;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.ISimplifiedBundle;
import appeng.block.AEBaseBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -112,23 +113,38 @@ public class BusRenderHelper implements IPartRenderHelper
}
@Override
public void useSimpliedRendering(int x, int y, int z, IPart p)
public ISimplifiedBundle useSimpliedRendering(int x, int y, int z, IPart p, ISimplifiedBundle sim)
{
RenderBlocksWorkaround rbw = BusRenderer.instance.renderer;
rbw.calculations = true;
rbw.faces.clear();
bbc.started = false;
p.getBoxes( bbc );
if ( sim != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, sim ) )
{
rbw.populate( sim );
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.calculations = false;
rbw.useTextures = false;
setBounds( bbc.minX, bbc.minY, bbc.minZ, bbc.maxX, bbc.maxY, bbc.maxZ );
return sim;
}
else
{
rbw.calculations = true;
rbw.faces.clear();
bbr.renderBlockBounds( rbw, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az );
rbw.renderStandardBlock( blk, x, y, z );
bbc.started = false;
p.getBoxes( bbc );
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.calculations = false;
rbw.useTextures = false;
setBounds( bbc.minX, bbc.minY, bbc.minZ, bbc.maxX, bbc.maxY, bbc.maxZ );
bbr.renderBlockBounds( rbw, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az );
rbw.renderStandardBlock( blk, x, y, z );
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.calculations = false;
rbw.useTextures = false;
return rbw.getLightingCache();
}
}
@Override

View file

@ -1,13 +1,16 @@
package appeng.client.render;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.ISimplifiedBundle;
import appeng.core.AELog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -19,35 +22,112 @@ public class RenderBlocksWorkaround extends RenderBlocks
public boolean calculations = true;
public EnumSet<ForgeDirection> faces = EnumSet.allOf( ForgeDirection.class );
private IIcon rXPos = null;
private IIcon rXNeg = null;
private IIcon rYPos = null;
private IIcon rYNeg = null;
private IIcon rZPos = null;
private IIcon rZNeg = null;
private class LightingCache implements ISimplifiedBundle
{
private boolean isAO = false;
public IIcon rXPos;
public IIcon rXNeg;
public IIcon rYPos;
public IIcon rYNeg;
public IIcon rZPos;
public IIcon rZNeg;
private int bXPos = 0;
private int bXNeg = 0;
private int bYPos = 0;
private int bYNeg = 0;
private int bZPos = 0;
private int bZNeg = 0;
public boolean isAO;
private int aoXPos[] = new int[5];
private int aoXNeg[] = new int[5];
private int aoYPos[] = new int[5];
private int aoYNeg[] = new int[5];
private int aoZPos[] = new int[5];
private int aoZNeg[] = new int[5];
public int bXPos;
public int bXNeg;
public int bYPos;
public int bYNeg;
public int bZPos;
public int bZNeg;
private float foXPos[] = new float[12];
private float foXNeg[] = new float[12];
private float foYPos[] = new float[12];
private float foYNeg[] = new float[12];
private float foZPos[] = new float[12];
private float foZNeg[] = new float[12];
public int aoXPos[];
public int aoXNeg[];
public int aoYPos[];
public int aoYNeg[];
public int aoZPos[];
public int aoZNeg[];
public float foXPos[];
public float foXNeg[];
public float foYPos[];
public float foYNeg[];
public float foZPos[];
public float foZNeg[];
public int lightHash;
public LightingCache(LightingCache secondCSrc) {
rXPos = secondCSrc.rXPos;
rXNeg = secondCSrc.rXNeg;
rYPos = secondCSrc.rYPos;
rYNeg = secondCSrc.rYNeg;
rZPos = secondCSrc.rZPos;
rZNeg = secondCSrc.rZNeg;
isAO = secondCSrc.isAO;
bXPos = secondCSrc.bXPos;
bXNeg = secondCSrc.bXNeg;
bYPos = secondCSrc.bYPos;
bYNeg = secondCSrc.bYNeg;
bZPos = secondCSrc.bZPos;
bZNeg = secondCSrc.bZNeg;
aoXPos = secondCSrc.aoXPos.clone();
aoXNeg = secondCSrc.aoXNeg.clone();
aoYPos = secondCSrc.aoYPos.clone();
aoYNeg = secondCSrc.aoYNeg.clone();
aoZPos = secondCSrc.aoZPos.clone();
aoZNeg = secondCSrc.aoZNeg.clone();
foXPos = secondCSrc.foXPos.clone();
foXNeg = secondCSrc.foXNeg.clone();
foYPos = secondCSrc.foYPos.clone();
foYNeg = secondCSrc.foYNeg.clone();
foZPos = secondCSrc.foZPos.clone();
foZNeg = secondCSrc.foZNeg.clone();
lightHash = secondCSrc.lightHash;
}
public LightingCache() {
rXPos = null;
rXNeg = null;
rYPos = null;
rYNeg = null;
rZPos = null;
rZNeg = null;
isAO = false;
bXPos = 0;
bXNeg = 0;
bYPos = 0;
bYNeg = 0;
bZPos = 0;
bZNeg = 0;
aoXPos = new int[5];
aoXNeg = new int[5];
aoYPos = new int[5];
aoYNeg = new int[5];
aoZPos = new int[5];
aoZNeg = new int[5];
foXPos = new float[12];
foXNeg = new float[12];
foYPos = new float[12];
foYNeg = new float[12];
foZPos = new float[12];
foZNeg = new float[12];
lightHash = 0;
}
};
private LightingCache lightState = new LightingCache();
public boolean isFacade = false;
public boolean useTextures = true;
@ -105,44 +185,44 @@ public class RenderBlocksWorkaround extends RenderBlocks
public void setTexture(IIcon ico)
{
rXPos = rXNeg = rYPos = rYNeg = rZPos = rZNeg = ico;
lightState.rXPos = lightState.rXNeg = lightState.rYPos = lightState.rYNeg = lightState.rZPos = lightState.rZNeg = ico;
}
public void setTexture(IIcon rYNeg, IIcon rYPos, IIcon rZNeg, IIcon rZPos, IIcon rXNeg, IIcon rXPos)
{
this.rXPos = rXPos;
this.rXNeg = rXNeg;
this.rYPos = rYPos;
this.rYNeg = rYNeg;
this.rZPos = rZPos;
this.rZNeg = rZNeg;
lightState.rXPos = rXPos;
lightState.rXNeg = rXNeg;
lightState.rYPos = rYPos;
lightState.rYNeg = rYNeg;
lightState.rZPos = rZPos;
lightState.rZNeg = rZNeg;
}
public boolean renderStandardBlockNoCalculations(Block b, int x, int y, int z)
{
Tessellator.instance.setBrightness( bXPos );
restoreAO( aoXPos, foXPos );
renderFaceXPos( b, x, y, z, useTextures ? rXPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bXPos );
restoreAO( lightState.aoXPos, lightState.foXPos );
renderFaceXPos( b, x, y, z, useTextures ? lightState.rXPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
Tessellator.instance.setBrightness( bXNeg );
restoreAO( aoXNeg, foXNeg );
renderFaceXNeg( b, x, y, z, useTextures ? rXNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bXNeg );
restoreAO( lightState.aoXNeg, lightState.foXNeg );
renderFaceXNeg( b, x, y, z, useTextures ? lightState.rXNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
Tessellator.instance.setBrightness( bYPos );
restoreAO( aoYPos, foYPos );
renderFaceYPos( b, x, y, z, useTextures ? rYPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bYPos );
restoreAO( lightState.aoYPos, lightState.foYPos );
renderFaceYPos( b, x, y, z, useTextures ? lightState.rYPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
Tessellator.instance.setBrightness( bYNeg );
restoreAO( aoYNeg, foYNeg );
renderFaceYNeg( b, x, y, z, useTextures ? rYNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bYNeg );
restoreAO( lightState.aoYNeg, lightState.foYNeg );
renderFaceYNeg( b, x, y, z, useTextures ? lightState.rYNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
Tessellator.instance.setBrightness( bZPos );
restoreAO( aoZPos, foZPos );
renderFaceZPos( b, x, y, z, useTextures ? rZPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bZPos );
restoreAO( lightState.aoZPos, lightState.foZPos );
renderFaceZPos( b, x, y, z, useTextures ? lightState.rZPos : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
Tessellator.instance.setBrightness( bZNeg );
restoreAO( aoZNeg, foZNeg );
renderFaceZNeg( b, x, y, z, useTextures ? rZNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
Tessellator.instance.setBrightness( lightState.bZNeg );
restoreAO( lightState.aoZNeg, lightState.foZNeg );
renderFaceZNeg( b, x, y, z, useTextures ? lightState.rZNeg : getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
return true;
}
@ -192,16 +272,19 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
@Override
public boolean renderStandardBlock(Block par1Block, int par2, int par3, int par4)
public boolean renderStandardBlock(Block blk, int x, int y, int z)
{
try
{
if ( calculations )
return super.renderStandardBlock( par1Block, par2, par3, par4 );
{
lightState.lightHash = getLightingHash( blk, this.blockAccess, x, y, z );
return super.renderStandardBlock( blk, x, y, z );
}
else
{
enableAO = isAO;
boolean out = renderStandardBlockNoCalculations( par1Block, par2, par3, par4 );
enableAO = lightState.isAO;
boolean out = renderStandardBlockNoCalculations( blk, x, y, z );
enableAO = false;
return out;
}
@ -258,10 +341,10 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rXNeg = par8Icon;
saveAO( aoXNeg, foXNeg );
bXNeg = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rXNeg = par8Icon;
saveAO( lightState.aoXNeg, lightState.foXNeg );
lightState.bXNeg = getCurrentBrightness();
}
}
@ -309,10 +392,10 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rXPos = par8Icon;
saveAO( aoXPos, foXPos );
bXPos = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rXPos = par8Icon;
saveAO( lightState.aoXPos, lightState.foXPos );
lightState.bXPos = getCurrentBrightness();
}
}
@ -388,10 +471,10 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rYNeg = par8Icon;
saveAO( aoYNeg, foYNeg );
bYNeg = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rYNeg = par8Icon;
saveAO( lightState.aoYNeg, lightState.foYNeg );
lightState.bYNeg = getCurrentBrightness();
}
}
@ -439,10 +522,10 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rYPos = par8Icon;
saveAO( aoYPos, foYPos );
bYPos = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rYPos = par8Icon;
saveAO( lightState.aoYPos, lightState.foYPos );
lightState.bYPos = getCurrentBrightness();
}
}
@ -490,10 +573,10 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rZNeg = par8Icon;
saveAO( aoZNeg, foZNeg );
bZNeg = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rZNeg = par8Icon;
saveAO( lightState.aoZNeg, lightState.foZNeg );
lightState.bZNeg = getCurrentBrightness();
}
}
@ -541,10 +624,41 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
else
{
isAO = enableAO;
rZPos = par8Icon;
saveAO( aoZPos, foZPos );
bZPos = getCurrentBrightness();
lightState.isAO = enableAO;
lightState.rZPos = par8Icon;
saveAO( lightState.aoZPos, lightState.foZPos );
lightState.bZPos = getCurrentBrightness();
}
}
public boolean similarLighting(Block blk, IBlockAccess w, int x, int y, int z, ISimplifiedBundle sim)
{
int lh = getLightingHash( blk, w, x, y, z );
return ((LightingCache) sim).lightHash == lh;
}
int lightHashTmp[] = new int[7];
private int getLightingHash(Block blk, IBlockAccess w, int x, int y, int z)
{
lightHashTmp[0] = blk.getMixedBrightnessForBlock( this.blockAccess, x, y, z );
lightHashTmp[1] = blk.getMixedBrightnessForBlock( this.blockAccess, x + 1, y, z );
lightHashTmp[2] = blk.getMixedBrightnessForBlock( this.blockAccess, x, y + 1, z );
lightHashTmp[3] = blk.getMixedBrightnessForBlock( this.blockAccess, x, y, z + 1 );
lightHashTmp[4] = blk.getMixedBrightnessForBlock( this.blockAccess, x - 1, y, z );
lightHashTmp[5] = blk.getMixedBrightnessForBlock( this.blockAccess, x, y - 1, z );
lightHashTmp[6] = blk.getMixedBrightnessForBlock( this.blockAccess, x, y, z - 1 );
return Arrays.hashCode( lightHashTmp );
}
public void populate(ISimplifiedBundle sim)
{
lightState = new LightingCache( (LightingCache) sim );
}
public ISimplifiedBundle getLightingCache()
{
return new LightingCache( lightState );
}
}

View file

@ -28,6 +28,7 @@ import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.ISimplifiedBundle;
import appeng.api.parts.PartItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
@ -43,6 +44,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradeableHost
{
protected ISimplifiedBundle renderCache = null;
protected AENetworkProxy proxy;
protected TileEntity tile = null;
protected IPartHost host = null;

View file

@ -94,7 +94,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockAnnihilationPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -77,7 +77,7 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -62,7 +62,7 @@ public class PartFormationPlane extends PartBasicState
boolean isActive = (clientFlags & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG);
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(),
CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : is.getIconIndex(),
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -98,7 +98,7 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -23,6 +23,7 @@ import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.ISimplifiedBundle;
import appeng.api.parts.PartItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -30,6 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PartCableAnchor implements IPart
{
protected ISimplifiedBundle renderCache = null;
ItemStack is = null;
ForgeDirection mySide = ForgeDirection.UP;
@ -41,6 +43,7 @@ public class PartCableAnchor implements IPart
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
IIcon myIcon = is.getIconIndex();
rh.setTexture( myIcon );
rh.setBounds( 7, 7, 10, 9, 9, 16 );

View file

@ -84,7 +84,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -283,7 +283,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );

View file

@ -165,7 +165,7 @@ public class PartToggleBus extends PartBasicState
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( is.getIconIndex() );
rh.setBounds( 6, 6, 14, 10, 10, 16 );

View file

@ -752,7 +752,7 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
boolean useCovered = false;
boolean requireDetailed = false;

View file

@ -138,7 +138,7 @@ public class PartCableCovered extends PartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( getTexture( getCableColor() ) );
EnumSet<ForgeDirection> sides = connections.clone();

View file

@ -156,7 +156,7 @@ public class PartCableSmart extends PartCable
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( getTexture( getCableColor() ) );
EnumSet<ForgeDirection> sides = connections.clone();

View file

@ -285,7 +285,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
rh.setTexture( getTypeTexture() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );