Reduce scope of variables

This commit is contained in:
thatsIch
2015-09-30 14:22:21 +02:00
parent dca09fe0a6
commit 059523f543
70 changed files with 151 additions and 199 deletions
@@ -59,7 +59,6 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
@Override
public boolean renderInWorld( B blk, IBlockAccess w, BlockPos pos, ModelGenerator renderer )
{
IAESprite theIcon = null;
boolean formed = false;
boolean emitsLight = false;
@@ -71,7 +70,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
}
boolean isMonitor = blk.getClass() == BlockCraftingMonitor.class;
theIcon = renderer.getIcon( w.getBlockState( pos ) )[EnumFacing.SOUTH.ordinal()];// blk.getIcon( AEPartLocation.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
IAESprite theIcon = renderer.getIcon( w.getBlockState( pos ) )[EnumFacing.SOUTH.ordinal()];
int meta = 1;
for( Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
@@ -299,11 +298,10 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRingLong.getIcon() );
}
double width = 3.0 / 16.0;
AEPartLocation dir = AEPartLocation.fromFacing( a );
if( !( i.getBound( dir ) < 0.001 || i.getBound( dir ) > 15.999 ) )
{
double width = 3.0 / 16.0;
switch( a )
{
case DOWN:
@@ -63,11 +63,8 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
IAESprite[] icoSet = { imb.getIcon( EnumFacing.UP, imb.getDefaultState() ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() };
int lumen = 14 << 20 | 14 << 4;
int brightness = imb.getMixedBrightnessForBlock( world, pos );
double offsetConstant = 0.001;
EnumSet<EnumFacing> validSides = EnumSet.noneOf( EnumFacing.class );
for( EnumFacing side : EnumFacing.VALUES )
@@ -78,6 +75,8 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
}
}
double offsetConstant = 0.001;
int lumen = 14 << 20 | 14 << 4;
for( Splotch s : tp.getDots() )
{
if( !validSides.contains( s.side ) )
@@ -85,7 +85,6 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
this.selectFace( renderer, west, up, forward, 5, 16 - 5, 9, 12 );
int offsetU = -4;
int offsetV = 8;
if( stat == 0 )
{
@@ -96,6 +95,7 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
renderer.setBrightness( b );
renderer.setColorOpaque_I( 0xffffff );
int offsetU = -4;
FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) );
if( forward == EnumFacing.EAST && ( up == EnumFacing.NORTH || up == EnumFacing.SOUTH ) )
{
@@ -117,8 +117,8 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
renderMax = 12.1f / 16.0f;
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
int bn = 15;
renderer.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
int bn = 15;
renderer.setBrightness( bn << 20 | bn << 4 );
for( EnumFacing side : EnumFacing.VALUES )
{
@@ -145,8 +145,8 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
renderMax = 16.01f / 16.0f;
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
int bn = 15;
renderer.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
int bn = 15;
renderer.setBrightness( bn << 20 | bn << 4 );
for( EnumFacing side : EnumFacing.VALUES )
{
@@ -46,18 +46,12 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
@Override
public void renderInventory( AEBaseBlock blk, ItemStack is, ModelGenerator renderer, ItemRenderType type, Object[] obj )
{
float Point2 = 6.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float singlePixel = 1.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float renderTop = 10.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float top = 8.0f / 16.0f;
float xOff = 0.0f;
float yOff = 0.0f;
float zOff = 0.0f;
@@ -65,6 +59,7 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff );
this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer );
float singlePixel = 1.0f / 16.0f;
renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff );
this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer );
@@ -75,6 +70,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
blk.getRendererInstance().setTemporaryRenderIcon( renderer.getIcon( Blocks.hopper.getDefaultState() )[0] );
renderer.renderAllFaces = true;
float top = 8.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point2 = 6.0f / 16.0f;
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
this.renderInvBlock( EnumSet.allOf( AEPartLocation.class ), blk, is, 0xffffff, renderer );
@@ -97,23 +96,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
{
IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, pos );
float Point2 = 6.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float singlePixel = 1.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float renderTop = 10.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float top = 8.0f / 16.0f;
float xOff = 0.0f;
float yOff = 0.0f;
float zOff = 0.0f;
renderer.renderAllFaces = true;
float zOff = 0.0f;
float yOff = 0.0f;
float xOff = 0.0f;
if( te != null )
{
AEPartLocation forward = AEPartLocation.fromFacing( te.getUp() );
@@ -122,10 +108,15 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
zOff = forward.zOffset * -( 4.0f / 16.0f );
}
float renderTop = 10.0f / 16.0f;
float renderBottom = 5.0f / 16.0f;
float Point12 = 9.0f / 16.0f;
float Point3 = 7.0f / 16.0f;
renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff );
super.renderInWorld( block, world, pos, renderer );
int r = ( pos.getX() + pos.getY() + pos.getZ() ) % 2;
float singlePixel = 1.0f / 16.0f;
if( r == 0 )
{
renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff );
@@ -145,6 +136,10 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
block.getRendererInstance().setTemporaryRenderIcon( renderer.getIcon( Blocks.hopper.getDefaultState() )[0] );
float top = 8.0f / 16.0f;
float bottom = 7.0f / 16.0f;
float Point13 = 10.0f / 16.0f;
float Point2 = 6.0f / 16.0f;
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
boolean out = renderer.renderStandardBlock( block, pos );
@@ -59,10 +59,10 @@ public class RenderSpatialPylon extends BaseBlockRender<BlockSpatialPylon, TileS
TileSpatialPylon sp = imb.getTileEntity( world, pos );
int displayBits = ( sp == null ) ? 0 : sp.getDisplayBits();
EnumFacing ori = null;//AEPartLocation.INTERNAL;
if( displayBits != 0 )
{
EnumFacing ori = null;//AEPartLocation.INTERNAL;
if( ( displayBits & TileSpatialPylon.DISPLAY_Z ) == TileSpatialPylon.DISPLAY_X )
{
ori = EnumFacing.EAST;