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
+3 -3
View File
@@ -113,14 +113,14 @@ public final class AEConfig extends Configuration implements IConfigurableObject
FMLCommonHandler.instance().bus().register( this );
final double DEFAULT_IC2_EXCHANGE = 2.0;
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
final double DEFAULT_RF_EXCHANGE = 0.5;
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
final double DEFAULT_IC2_EXCHANGE = 2.0;
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
final double DEFAULT_RF_EXCHANGE = 0.5;
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
+1 -2
View File
@@ -238,12 +238,11 @@ public class ApiPart implements IPartHelper
public ClassNode getReader( String name )
{
ClassReader cr;
String path = '/' + name.replace( ".", "/" ) + ".class";
InputStream is = this.getClass().getResourceAsStream( path );
try
{
cr = new ClassReader( is );
ClassReader cr = new ClassReader( is );
ClassNode cn = new ClassNode();
cr.accept( cn, ClassReader.EXPAND_FRAMES );
@@ -54,10 +54,9 @@ public final class GridCacheRegistry implements IGridCacheRegistry
for( Class<? extends IGridCache> iface : this.caches.keySet() )
{
Constructor<? extends IGridCache> c;
try
{
c = this.caches.get( iface ).getConstructor( IGrid.class );
Constructor<? extends IGridCache> c = this.caches.get( iface ).getConstructor( IGrid.class );
map.put( iface, c.newInstance( g ) );
}
catch( NoSuchMethodException e )
@@ -544,7 +544,6 @@ public enum GuiBridge implements IGuiHandler
{
if( te instanceof IActionHost && this.requiredPermission != null )
{
boolean requirePower = false;
IGridNode gn = ( (IActionHost) te ).getActionableNode();
if( gn != null )
@@ -552,6 +551,7 @@ public enum GuiBridge implements IGuiHandler
IGrid g = gn.getGrid();
if( g != null )
{
boolean requirePower = false;
if( requirePower )
{
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
@@ -45,11 +45,10 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
final EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
try
{
packetType = stream.readInt();
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
PacketCallState callState =
@@ -91,10 +91,9 @@ public class PacketCraftRequest extends AppEngPacket
return;
}
Future<ICraftingJob> futureJob = null;
cca.whatToMake.setStackSize( this.amount );
Future<ICraftingJob> futureJob = null;
try
{
ICraftingGrid cg = g.getCache( ICraftingGrid.class );