Remove redundant type casts

This commit is contained in:
thatsIch 2015-09-25 22:30:38 +02:00
parent bcba2329b7
commit 80e1a2863b
9 changed files with 96 additions and 117 deletions

View file

@ -103,10 +103,9 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
} }
@Override @Override
public boolean renderInWorld( BlockMolecularAssembler block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( BlockMolecularAssembler maBlock, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
BlockMolecularAssembler blk = (BlockMolecularAssembler) block; TileMolecularAssembler tma = maBlock.getTileEntity( world, x, y, z );
TileMolecularAssembler tma = blk.getTileEntity( world, x, y, z );
if( BlockMolecularAssembler.booleanAlphaPass ) if( BlockMolecularAssembler.booleanAlphaPass )
{ {
@ -116,12 +115,12 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
TaughtIcon lights = new TaughtIcon( ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), -2.0f ); TaughtIcon lights = new TaughtIcon( ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), -2.0f );
Tessellator.instance.setColorRGBA_F( 1, 1, 1, 0.3f ); Tessellator.instance.setColorRGBA_F( 1, 1, 1, 0.3f );
Tessellator.instance.setBrightness( 14 << 20 | 14 << 4 ); Tessellator.instance.setBrightness( 14 << 20 | 14 << 4 );
renderer.renderFaceXNeg( blk, x, y, z, lights ); renderer.renderFaceXNeg( maBlock, x, y, z, lights );
renderer.renderFaceXPos( blk, x, y, z, lights ); renderer.renderFaceXPos( maBlock, x, y, z, lights );
renderer.renderFaceYNeg( blk, x, y, z, lights ); renderer.renderFaceYNeg( maBlock, x, y, z, lights );
renderer.renderFaceYPos( blk, x, y, z, lights ); renderer.renderFaceYPos( maBlock, x, y, z, lights );
renderer.renderFaceZNeg( blk, x, y, z, lights ); renderer.renderFaceZNeg( maBlock, x, y, z, lights );
renderer.renderFaceZPos( blk, x, y, z, lights ); renderer.renderFaceZPos( maBlock, x, y, z, lights );
return true; return true;
} }
return false; return false;
@ -130,12 +129,12 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess; BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
renderer = BusRenderer.INSTANCE.renderer; renderer = BusRenderer.INSTANCE.renderer;
this.preRenderInWorld( block, world, x, y, z, renderer ); this.preRenderInWorld( maBlock, world, x, y, z, renderer );
tma.lightCache = BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.lightCache ); tma.lightCache = BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.lightCache );
BusRenderer.INSTANCE.renderer.isFacade = true; BusRenderer.INSTANCE.renderer.isFacade = true;
IOrientable te = this.getOrientable( block, world, x, y, z ); IOrientable te = this.getOrientable( maBlock, world, x, y, z );
ForgeDirection fdy = te.getUp(); ForgeDirection fdy = te.getUp();
ForgeDirection fdz = te.getForward(); ForgeDirection fdz = te.getForward();
@ -143,54 +142,54 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
renderer.renderAllFaces = true; renderer.renderAllFaces = true;
this.renderCableAt( 0.11D, world, x, y, z, block, renderer, 0.141D, false ); this.renderCableAt( 0.11D, world, x, y, z, maBlock, renderer, 0.141D, false );
this.renderCableAt( 0.188D, world, x, y, z, block, renderer, 0.1875D, true ); this.renderCableAt( 0.188D, world, x, y, z, maBlock, renderer, 0.1875D, true );
blk.getRendererInstance().setTemporaryRenderIcon( blk.getIcon( 0, 0 ) ); maBlock.getRendererInstance().setTemporaryRenderIcon( maBlock.getIcon( 0, 0 ) );
this.renderBlockBounds( renderer, 2, 14, 0, 14, 16, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 2, 14, 0, 14, 16, 2, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 0, 14, 2, 2, 16, 14, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 14, 2, 2, 16, 14, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 2, 0, 14, 14, 2, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 2, 0, 14, 14, 2, 16, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 14, 0, 2, 16, 2, 14, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 14, 0, 2, 16, 2, 14, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
// sides... // sides...
this.renderBlockBounds( renderer, 0, 0, 0, 16, 2, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 0, 0, 16, 2, 2, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 0, 2, 0, 2, 16, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 2, 0, 2, 16, 2, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 0, 0, 2, 2, 2, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 0, 2, 2, 2, 16, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 0, 14, 14, 16, 16, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 14, 14, 16, 16, 16, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 14, 0, 14, 16, 14, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 14, 0, 14, 16, 14, 16, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 14, 14, 0, 16, 16, 14, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 14, 14, 0, 16, 16, 14, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 14, 2, 0, 16, 14, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 14, 2, 0, 16, 14, 2, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 0, 2, 14, 2, 14, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 2, 14, 2, 14, 16, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, fdx, fdy, fdz );
renderer.renderStandardBlock( blk, x, y, z ); renderer.renderStandardBlock( maBlock, x, y, z );
BusRenderHelper.INSTANCE.normalRendering(); BusRenderHelper.INSTANCE.normalRendering();
blk.getRendererInstance().setTemporaryRenderIcon( null ); maBlock.getRendererInstance().setTemporaryRenderIcon( null );
renderer.renderAllFaces = false; renderer.renderAllFaces = false;
BusRenderer.INSTANCE.renderer.isFacade = false; BusRenderer.INSTANCE.renderer.isFacade = false;

View file

@ -28,7 +28,6 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.client.IItemRenderer.ItemRenderType;
@ -87,8 +86,6 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
{ {
this.preRenderInWorld( block, world, x, y, z, renderer ); this.preRenderInWorld( block, world, x, y, z, renderer );
final BlockCharger blk = (BlockCharger) block;
final IOrientable te = this.getOrientable( block, world, x, y, z ); final IOrientable te = this.getOrientable( block, world, x, y, z );
final ForgeDirection fdy = te.getUp(); final ForgeDirection fdy = te.getUp();
@ -97,28 +94,28 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
renderer.renderAllFaces = true; renderer.renderAllFaces = true;
this.renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz );
boolean out = renderer.renderStandardBlock( blk, x, y, z ); boolean out = renderer.renderStandardBlock( block, x, y, z );
blk.getRendererInstance().setTemporaryRenderIcons( ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null, null ); block.getRendererInstance().setTemporaryRenderIcons( ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null, null );
this.renderBlockBounds( renderer, 2, 0, 2, 14, 3, 14, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 2, 0, 2, 14, 3, 14, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
this.renderBlockBounds( renderer, 3, 3, 3, 13, 4, 13, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 3, 3, 3, 13, 4, 13, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
blk.getRendererInstance().setTemporaryRenderIcon( null ); block.getRendererInstance().setTemporaryRenderIcon( null );
blk.getRendererInstance().setTemporaryRenderIcons( null, ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null ); block.getRendererInstance().setTemporaryRenderIcons( null, ExtraBlockTextures.BlockChargerInside.getIcon(), null, null, null, null );
this.renderBlockBounds( renderer, 2, 13, 2, 14, 16, 14, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 2, 13, 2, 14, 16, 14, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
this.renderBlockBounds( renderer, 3, 12, 3, 13, 13, 13, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 3, 12, 3, 13, 13, 13, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
renderer.renderAllFaces = false; renderer.renderAllFaces = false;
blk.getRendererInstance().setTemporaryRenderIcon( null ); block.getRendererInstance().setTemporaryRenderIcon( null );
this.postRenderInWorld( renderer ); this.postRenderInWorld( renderer );
return out; return out;
@ -127,11 +124,7 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
@Override @Override
public void renderTile( BlockCharger block, TileCharger tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( BlockCharger block, TileCharger tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
ItemStack sis = null; final ItemStack sis = tile.getStackInSlot( 0 );
if( tile instanceof IInventory )
{
sis = ( (IInventory) tile ).getStackInSlot( 0 );
}
if( sis != null ) if( sis != null )
{ {

View file

@ -59,15 +59,14 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
@Override @Override
public void renderTile( BlockCraftingMonitor block, TileCraftingMonitorTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( BlockCraftingMonitor block, TileCraftingMonitorTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
if( tile instanceof TileCraftingMonitorTile ) if( tile != null )
{ {
TileCraftingMonitorTile cmt = (TileCraftingMonitorTile) tile; final IAEItemStack ais = tile.getJobProgress();
IAEItemStack ais = cmt.getJobProgress();
if( cmt.dspList == null ) if( tile.dspList == null )
{ {
cmt.updateList = true; tile.updateList = true;
cmt.dspList = GLAllocation.generateDisplayLists( 1 ); tile.dspList = GLAllocation.generateDisplayLists( 1 );
} }
if( ais != null ) if( ais != null )
@ -75,16 +74,16 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 ); GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
if( cmt.updateList ) if( tile.updateList )
{ {
cmt.updateList = false; tile.updateList = false;
GL11.glNewList( cmt.dspList, GL11.GL_COMPILE_AND_EXECUTE ); GL11.glNewList( tile.dspList, GL11.GL_COMPILE_AND_EXECUTE );
this.tesrRenderScreen( tess, cmt, ais ); this.tesrRenderScreen( tess, tile, ais );
GL11.glEndList(); GL11.glEndList();
} }
else else
{ {
GL11.glCallList( cmt.dspList ); GL11.glCallList( tile.dspList );
} }
GL11.glPopMatrix(); GL11.glPopMatrix();

View file

@ -67,8 +67,7 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
@Override @Override
public void renderTile( BlockCrank blk, TileCrank tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks ) public void renderTile( BlockCrank blk, TileCrank tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks )
{ {
TileCrank tc = (TileCrank) tile; if( tile.getUp() == null || tile.getUp() == ForgeDirection.UNKNOWN )
if( tc.getUp() == null || tc.getUp() == ForgeDirection.UNKNOWN )
{ {
return; return;
} }
@ -90,21 +89,21 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
GL11.glTranslated( 0.5, 0, 0.5 ); GL11.glTranslated( 0.5, 0, 0.5 );
GL11.glRotatef( tc.visibleRotation, 0, 1, 0 ); GL11.glRotatef( tile.visibleRotation, 0, 1, 0 );
GL11.glTranslated( -0.5, 0, -0.5 ); GL11.glTranslated( -0.5, 0, -0.5 );
tess.setTranslation( -tc.xCoord, -tc.yCoord, -tc.zCoord ); tess.setTranslation( -tile.xCoord, -tile.yCoord, -tile.zCoord );
tess.startDrawingQuads(); tess.startDrawingQuads();
renderBlocks.renderAllFaces = true; renderBlocks.renderAllFaces = true;
renderBlocks.blockAccess = tc.getWorldObj(); renderBlocks.blockAccess = tile.getWorldObj();
renderBlocks.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.1, 0.5D + 0.05 ); renderBlocks.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.1, 0.5D + 0.05 );
renderBlocks.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); renderBlocks.renderStandardBlock( blk, tile.xCoord, tile.yCoord, tile.zCoord );
renderBlocks.setRenderBounds( 0.70D - 0.15, 0.55D - 0.05, 0.5D - 0.05, 0.70D + 0.15, 0.55D + 0.05, 0.5D + 0.05 ); renderBlocks.setRenderBounds( 0.70D - 0.15, 0.55D - 0.05, 0.5D - 0.05, 0.70D + 0.15, 0.55D + 0.05, 0.5D + 0.05 );
renderBlocks.renderStandardBlock( blk, tc.xCoord, tc.yCoord, tc.zCoord ); renderBlocks.renderStandardBlock( blk, tile.xCoord, tile.yCoord, tile.zCoord );
tess.draw(); tess.draw();
tess.setTranslation( 0, 0, 0 ); tess.setTranslation( 0, 0, 0 );

View file

@ -108,8 +108,6 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
{ {
this.preRenderInWorld( block, world, x, y, z, renderer ); this.preRenderInWorld( block, world, x, y, z, renderer );
final BlockInscriber blk = (BlockInscriber) block;
final IOrientable te = this.getOrientable( block, world, x, y, z ); final IOrientable te = this.getOrientable( block, world, x, y, z );
if( te == null ) if( te == null )
{ {
@ -124,25 +122,25 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
// sides... // sides...
this.renderBlockBounds( renderer, 3, 1, 0, 13, 15, 3, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 3, 1, 0, 13, 15, 3, fdx, fdy, fdz );
boolean out = renderer.renderStandardBlock( blk, x, y, z ); boolean out = renderer.renderStandardBlock( block, x, y, z );
this.renderBlockBounds( renderer, 0, 1, 0, 3, 15, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 0, 1, 0, 3, 15, 16, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
this.renderBlockBounds( renderer, 13, 1, 0, 16, 15, 16, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 13, 1, 0, 16, 15, 16, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
// top bottom.. // top bottom..
this.renderBlockBounds( renderer, 1, 0, 1, 15, 4, 15, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 1, 0, 1, 15, 4, 15, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
this.renderBlockBounds( renderer, 1, 12, 1, 15, 16, 15, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 1, 12, 1, 15, 16, 15, fdx, fdy, fdz );
out = renderer.renderStandardBlock( blk, x, y, z ); out = renderer.renderStandardBlock( block, x, y, z );
blk.getRendererInstance().setTemporaryRenderIcon( null ); block.getRendererInstance().setTemporaryRenderIcon( null );
renderer.renderAllFaces = false; renderer.renderAllFaces = false;
blk.getRendererInstance().setTemporaryRenderIcon( null ); block.getRendererInstance().setTemporaryRenderIcon( null );
this.postRenderInWorld( renderer ); this.postRenderInWorld( renderer );
return out; return out;
@ -151,8 +149,6 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
@Override @Override
public void renderTile( BlockInscriber block, TileInscriber tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( BlockInscriber block, TileInscriber tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
TileInscriber inv = (TileInscriber) tile;
GL11.glPushMatrix(); GL11.glPushMatrix();
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() ); this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
@ -161,7 +157,7 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
GL11.glDisable( GL12.GL_RESCALE_NORMAL ); GL11.glDisable( GL12.GL_RESCALE_NORMAL );
GL11.glCullFace( GL11.GL_FRONT ); GL11.glCullFace( GL11.GL_FRONT );
Minecraft mc = Minecraft.getMinecraft(); final Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture( TextureMap.locationBlocksTexture ); mc.renderEngine.bindTexture( TextureMap.locationBlocksTexture );
// << 20 | light << 4; // << 20 | light << 4;
@ -171,37 +167,34 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 ); OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
final float TwoPx = 2.0f / 16.0f;
float middle = 0.5f;
float press = 0.2f;
final float base = 0.4f;
long absoluteProgress = 0; long absoluteProgress = 0;
if( inv.smash ) if( tile.smash )
{ {
long currentTime = System.currentTimeMillis(); final long currentTime = System.currentTimeMillis();
absoluteProgress = currentTime - inv.clientStart; absoluteProgress = currentTime - tile.clientStart;
if( absoluteProgress > 800 ) if( absoluteProgress > 800 )
{ {
inv.smash = false; tile.smash = false;
} }
} }
float relativeProgress = absoluteProgress % 800 / 400.0f; final float relativeProgress = absoluteProgress % 800 / 400.0f;
float progress = relativeProgress; float progress = relativeProgress;
if( progress > 1.0f ) if( progress > 1.0f )
{ {
progress = 1.0f - ( progress - 1.0f ); progress = 1.0f - ( progress - 1.0f );
} }
float press = 0.2f;
press -= progress / 5.0f; press -= progress / 5.0f;
IIcon ic = ExtraBlockTextures.BlockInscriberInside.getIcon(); final IIcon ic = ExtraBlockTextures.BlockInscriberInside.getIcon();
tess.startDrawingQuads(); tess.startDrawingQuads();
float middle = 0.5f;
middle += 0.02f; middle += 0.02f;
final float TwoPx = 2.0f / 16.0f;
tess.addVertexWithUV( TwoPx, middle + press, TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 2 ) ); tess.addVertexWithUV( TwoPx, middle + press, TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 2 ) );
tess.addVertexWithUV( 1.0 - TwoPx, middle + press, TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 2 ) ); tess.addVertexWithUV( 1.0 - TwoPx, middle + press, TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 2 ) );
tess.addVertexWithUV( 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 13 ) ); tess.addVertexWithUV( 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 13 ) );
@ -209,6 +202,7 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
tess.addVertexWithUV( TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 ) ); tess.addVertexWithUV( TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 ) );
tess.addVertexWithUV( 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 ) ); tess.addVertexWithUV( 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 ) );
final float base = 0.4f;
tess.addVertexWithUV( 1.0 - TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) ); tess.addVertexWithUV( 1.0 - TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
tess.addVertexWithUV( TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) ); tess.addVertexWithUV( TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
@ -231,26 +225,26 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
GL11.glPopMatrix(); GL11.glPopMatrix();
int items = 0; int items = 0;
if( inv.getStackInSlot( 0 ) != null ) if( tile.getStackInSlot( 0 ) != null )
{ {
items++; items++;
} }
if( inv.getStackInSlot( 1 ) != null ) if( tile.getStackInSlot( 1 ) != null )
{ {
items++; items++;
} }
if( inv.getStackInSlot( 2 ) != null ) if( tile.getStackInSlot( 2 ) != null )
{ {
items++; items++;
} }
if( relativeProgress > 1.0f || items == 0 ) if( relativeProgress > 1.0f || items == 0 )
{ {
ItemStack is = inv.getStackInSlot( 3 ); ItemStack is = tile.getStackInSlot( 3 );
if( is == null ) if( is == null )
{ {
IInscriberRecipe ir = inv.getTask(); final IInscriberRecipe ir = tile.getTask();
if( ir != null ) if( ir != null )
{ {
is = ir.getOutput().copy(); is = ir.getOutput().copy();
@ -261,9 +255,9 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
} }
else else
{ {
this.renderItem( inv.getStackInSlot( 0 ), press, block, tile, tess, x, y, z, f, renderer ); this.renderItem( tile.getStackInSlot( 0 ), press, block, tile, tess, x, y, z, f, renderer );
this.renderItem( inv.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer ); this.renderItem( tile.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer );
this.renderItem( inv.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer ); this.renderItem( tile.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer );
} }
} }

View file

@ -81,15 +81,13 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
} }
@Override @Override
public void renderTile( BlockSkyChest block, TileSkyChest tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer ) public void renderTile( BlockSkyChest block, TileSkyChest skyChest, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer )
{ {
if( !( tile instanceof TileSkyChest ) ) if( skyChest == null )
{ {
return; return;
} }
final TileSkyChest skyChest = (TileSkyChest) tile;
if( !skyChest.hasWorldObj() ) if( !skyChest.hasWorldObj() )
{ {
return; return;
@ -98,7 +96,7 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
GL11.glEnable( GL12.GL_RESCALE_NORMAL ); GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
final int metaData = tile.getWorldObj().getBlockMetadata( tile.xCoord, tile.yCoord, tile.zCoord ); final int metaData = skyChest.getWorldObj().getBlockMetadata( skyChest.xCoord, skyChest.yCoord, skyChest.zCoord );
final ResourceLocation loc = METADATA_TO_TEXTURE[metaData]; final ResourceLocation loc = METADATA_TO_TEXTURE[metaData];
Minecraft.getMinecraft().getTextureManager().bindTexture( loc ); Minecraft.getMinecraft().getTextureManager().bindTexture( loc );

View file

@ -179,15 +179,13 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
} }
@Override @Override
public void renderTile( BlockSkyCompass block, TileSkyCompass tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer ) public void renderTile( BlockSkyCompass block, TileSkyCompass skyCompass, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer )
{ {
if( !( tile instanceof TileSkyCompass ) ) if( skyCompass == null )
{ {
return; return;
} }
TileSkyCompass skyCompass = (TileSkyCompass) tile;
if( !skyCompass.hasWorldObj() ) if( !skyCompass.hasWorldObj() )
{ {
return; return;
@ -197,7 +195,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glCullFace( GL11.GL_FRONT ); GL11.glCullFace( GL11.GL_FRONT );
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" ); final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
Minecraft.getMinecraft().getTextureManager().bindTexture( loc ); Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
@ -211,7 +209,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
CompassResult cr = null; CompassResult cr = null;
if( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN ) if( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN )
{ {
cr = CompassManager.INSTANCE.getCompassDirection( 0, tile.xCoord, tile.yCoord, tile.zCoord ); cr = CompassManager.INSTANCE.getCompassDirection( 0, skyCompass.xCoord, skyCompass.yCoord, skyCompass.zCoord );
} }
else else
{ {

View file

@ -48,16 +48,15 @@ public class RenderQuartzOre extends BaseBlockRender<OreQuartz, AEBaseTile>
} }
@Override @Override
public boolean renderInWorld( OreQuartz block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( OreQuartz quartz, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
OreQuartz blk = (OreQuartz) block; quartz.setEnhanceBrightness( true );
blk.setEnhanceBrightness( true ); super.renderInWorld( quartz, world, x, y, z, renderer );
super.renderInWorld( block, world, x, y, z, renderer ); quartz.setEnhanceBrightness( false );
blk.setEnhanceBrightness( false );
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() ); quartz.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() );
boolean out = super.renderInWorld( block, world, x, y, z, renderer ); final boolean out = super.renderInWorld( quartz, world, x, y, z, renderer );
blk.getRendererInstance().setTemporaryRenderIcon( null ); quartz.getRendererInstance().setTemporaryRenderIcon( null );
return out; return out;
} }

View file

@ -65,12 +65,12 @@ public class RendererCableBus extends BaseBlockRender<BlockCableBus, TileCableBu
} }
@Override @Override
public void renderTile( BlockCableBus block, TileCableBus t, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( BlockCableBus block, TileCableBus cableBus, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
if( t instanceof TileCableBus ) if( cableBus != null )
{ {
BusRenderer.INSTANCE.renderer.overrideBlockTexture = null; BusRenderer.INSTANCE.renderer.overrideBlockTexture = null;
( (TileCableBus) t ).cb.renderDynamic( x, y, z ); cableBus.cb.renderDynamic( x, y, z );
} }
} }
} }