Reduce scope of variables

This commit is contained in:
thatsIch
2015-09-25 22:52:41 +02:00
parent f4ff28d2a6
commit 0387d30d1c
78 changed files with 174 additions and 218 deletions
+3 -3
View File
@@ -115,14 +115,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 );
@@ -40,13 +40,12 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
public void onPacketData( INetworkInfo network, FMLProxyPacket packet, EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
player = Minecraft.getMinecraft().thePlayer;
try
{
packetType = stream.readInt();
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
pack.clientPacketData( network, pack, player );
}
@@ -39,11 +39,10 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
public void onPacketData( INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
try
{
packetType = stream.readInt();
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
pack.serverPacketData( manager, pack, player );
}
@@ -92,10 +92,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 );