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
@@ -92,12 +92,11 @@ public class ItemPaintBall extends AEBaseItem
int r = ( colorValue >> 16 ) & 0xff;
int g = ( colorValue >> 8 ) & 0xff;
int b = ( colorValue ) & 0xff;
int full = (int) ( 255 * 0.3 );
float fail = 0.7f;
if( stack.getItemDamage() >= 20 )
{
float fail = 0.7f;
int full = (int) ( 255 * 0.3 );
return (int)( full + r * fail ) << 16 | (int)( full + g * fail ) << 8 | (int)( full + b * fail ) | 0xff << 24;
}
else
@@ -159,7 +159,6 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
int targetZ = max.z - min.z - 1;
int maxSize = this.getMaxStoredDim( is );
int floorBuffer = 64;
World destination = this.getWorld( is );
if( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) )
@@ -171,6 +170,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
destination = this.createNewWorld( is );
}
int floorBuffer = 64;
StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
this.setStoredSize( is, targetX, targetY, targetZ );
@@ -133,7 +133,6 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
float hitZ )
{
Block blk = w.getBlockState( pos ).getBlock();
double powerPerUse = 100;
ItemStack paintBall = this.getColor( is );
@@ -157,6 +156,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
return false;
}
double powerPerUse = 100;
if( paintBall != null && paintBall.getItem() instanceof ItemSnowball )
{
TileEntity te = w.getTileEntity( pos );
@@ -204,9 +204,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
Entity entity = null;
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;
int l;
for( l = 0; l < list.size(); ++l )
for( int l = 0; l < list.size(); ++l )
{
Entity entity1 = (Entity) list.get( l );
@@ -323,9 +322,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
Entity entity = null;
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;
int l;
for( l = 0; l < list.size(); ++l )
for( int l = 0; l < list.size(); ++l )
{
Entity entity1 = (Entity) list.get( l );