final variables and parameters
This commit is contained in:
@@ -56,7 +56,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load( FMLInitializationEvent event )
|
||||
public void load( final FMLInitializationEvent event )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData( Map<String, Object> data )
|
||||
public void injectData( final Map<String, Object> data )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public final class AppEngCore extends DummyModContainer implements IFMLLoadingPl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerBus( EventBus bus, LoadController controller )
|
||||
public boolean registerBus( final EventBus bus, final LoadController controller )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,22 +37,22 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException
|
||||
private boolean deobf = false;
|
||||
|
||||
@Override
|
||||
public void initGui( GuiErrorScreen errorScreen, FontRenderer fontRenderer )
|
||||
public void initGui( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer )
|
||||
{
|
||||
Class<?> clz = errorScreen.getClass();
|
||||
final Class<?> clz = errorScreen.getClass();
|
||||
try
|
||||
{
|
||||
clz.getField( "mc" );
|
||||
this.deobf = true;
|
||||
}
|
||||
catch( Throwable ignored )
|
||||
catch( final Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime )
|
||||
public void drawScreen( final GuiErrorScreen errorScreen, final FontRenderer fontRenderer, final int mouseRelX, final int mouseRelY, final float tickTime )
|
||||
{
|
||||
int offset = 10;
|
||||
this.drawCenteredString( fontRenderer, "Sorry, couldn't load AE2 properly.", errorScreen.width / 2, offset, COLOR_WHITE );
|
||||
@@ -89,7 +89,7 @@ public final class MissingCoreMod extends CustomModLoadingErrorDisplayException
|
||||
}
|
||||
}
|
||||
|
||||
private void drawCenteredString( FontRenderer fontRenderer, String string, int x, int y, int colour )
|
||||
private void drawCenteredString( final FontRenderer fontRenderer, final String string, final int x, final int y, final int colour )
|
||||
{
|
||||
final String reEncoded = string.replaceAll( "\\P{InBasic_Latin}", "" );
|
||||
final int reEncodedWidth = fontRenderer.getStringWidth( reEncoded );
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
* Side, Display Name, ModID ClassPostFix
|
||||
*/
|
||||
|
||||
for( IntegrationType type : IntegrationType.values() )
|
||||
for( final IntegrationType type : IntegrationType.values() )
|
||||
{
|
||||
IntegrationRegistry.INSTANCE.add( type );
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public byte[] transform( String name, String transformedName, byte[] basicClass )
|
||||
public byte[] transform( final String name, final String transformedName, final byte[] basicClass )
|
||||
{
|
||||
if( basicClass == null || transformedName.startsWith( "appeng.transformer" ) )
|
||||
{
|
||||
@@ -78,22 +78,22 @@ public final class ASMIntegration implements IClassTransformer
|
||||
|
||||
if( transformedName.startsWith( "appeng." ) )
|
||||
{
|
||||
ClassNode classNode = new ClassNode();
|
||||
ClassReader classReader = new ClassReader( basicClass );
|
||||
final ClassNode classNode = new ClassNode();
|
||||
final ClassReader classReader = new ClassReader( basicClass );
|
||||
classReader.accept( classNode, 0 );
|
||||
|
||||
try
|
||||
{
|
||||
boolean reWrite = this.removeOptionals( classNode );
|
||||
final boolean reWrite = this.removeOptionals( classNode );
|
||||
|
||||
if( reWrite )
|
||||
{
|
||||
ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS );
|
||||
final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS );
|
||||
classNode.accept( writer );
|
||||
return writer.toByteArray();
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
t.printStackTrace();
|
||||
}
|
||||
@@ -101,13 +101,13 @@ public final class ASMIntegration implements IClassTransformer
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
private boolean removeOptionals( ClassNode classNode )
|
||||
private boolean removeOptionals( final ClassNode classNode )
|
||||
{
|
||||
boolean changed = false;
|
||||
|
||||
if( classNode.visibleAnnotations != null )
|
||||
{
|
||||
for( AnnotationNode an : classNode.visibleAnnotations )
|
||||
for( final AnnotationNode an : classNode.visibleAnnotations )
|
||||
{
|
||||
if( this.hasAnnotation( an, Integration.Interface.class ) )
|
||||
{
|
||||
@@ -118,7 +118,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
}
|
||||
else if( this.hasAnnotation( an, Integration.InterfaceList.class ) )
|
||||
{
|
||||
for( Object o : ( (Iterable) an.values.get( 1 ) ) )
|
||||
for( final Object o : ( (Iterable) an.values.get( 1 ) ) )
|
||||
{
|
||||
if( this.stripInterface( classNode, Integration.InterfaceList.class, (AnnotationNode) o ) )
|
||||
{
|
||||
@@ -129,14 +129,14 @@ public final class ASMIntegration implements IClassTransformer
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<MethodNode> i = classNode.methods.iterator();
|
||||
final Iterator<MethodNode> i = classNode.methods.iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
MethodNode mn = i.next();
|
||||
final MethodNode mn = i.next();
|
||||
|
||||
if( mn.visibleAnnotations != null )
|
||||
{
|
||||
for( AnnotationNode an : mn.visibleAnnotations )
|
||||
for( final AnnotationNode an : mn.visibleAnnotations )
|
||||
{
|
||||
if( this.hasAnnotation( an, Integration.Method.class ) )
|
||||
{
|
||||
@@ -157,12 +157,12 @@ public final class ASMIntegration implements IClassTransformer
|
||||
return changed;
|
||||
}
|
||||
|
||||
private boolean hasAnnotation( AnnotationNode ann, Class<?> annotation )
|
||||
private boolean hasAnnotation( final AnnotationNode ann, final Class<?> annotation )
|
||||
{
|
||||
return ann.desc.equals( Type.getDescriptor( annotation ) );
|
||||
}
|
||||
|
||||
private boolean stripInterface( ClassNode classNode, Class<?> class1, AnnotationNode an )
|
||||
private boolean stripInterface( final ClassNode classNode, final Class<?> class1, final AnnotationNode an )
|
||||
{
|
||||
if( an.values.size() != 4 )
|
||||
{
|
||||
@@ -212,7 +212,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean stripMethod( ClassNode classNode, MethodNode mn, Iterator<MethodNode> i, Class class1, AnnotationNode an )
|
||||
private boolean stripMethod( final ClassNode classNode, final MethodNode mn, final Iterator<MethodNode> i, final Class class1, final AnnotationNode an )
|
||||
{
|
||||
if( an.values.size() != 2 )
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
|
||||
if( iName != null )
|
||||
{
|
||||
IntegrationType type = IntegrationType.valueOf( iName );
|
||||
final IntegrationType type = IntegrationType.valueOf( iName );
|
||||
if( !IntegrationRegistry.INSTANCE.isEnabled( type ) )
|
||||
{
|
||||
this.log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." );
|
||||
@@ -248,7 +248,7 @@ public final class ASMIntegration implements IClassTransformer
|
||||
return false;
|
||||
}
|
||||
|
||||
private void log( String string )
|
||||
private void log( final String string )
|
||||
{
|
||||
FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string );
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class ASMTweaker implements IClassTransformer
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public byte[] transform( String name, String transformedName, byte[] basicClass )
|
||||
public byte[] transform( final String name, final String transformedName, final byte[] basicClass )
|
||||
{
|
||||
if( basicClass == null )
|
||||
{
|
||||
@@ -77,11 +77,11 @@ public final class ASMTweaker implements IClassTransformer
|
||||
{
|
||||
if( transformedName != null && this.privateToPublicMethods.containsKey( transformedName ) )
|
||||
{
|
||||
ClassNode classNode = new ClassNode();
|
||||
ClassReader classReader = new ClassReader( basicClass );
|
||||
final ClassNode classNode = new ClassNode();
|
||||
final ClassReader classReader = new ClassReader( basicClass );
|
||||
classReader.accept( classNode, 0 );
|
||||
|
||||
for( PublicLine set : this.privateToPublicMethods.get( transformedName ) )
|
||||
for( final PublicLine set : this.privateToPublicMethods.get( transformedName ) )
|
||||
{
|
||||
this.makePublic( classNode, set );
|
||||
}
|
||||
@@ -89,11 +89,11 @@ public final class ASMTweaker implements IClassTransformer
|
||||
// CALL VIRTUAL!
|
||||
if( transformedName.equals( "net.minecraft.client.gui.inventory.GuiContainer" ) )
|
||||
{
|
||||
for( MethodNode mn : classNode.methods )
|
||||
for( final MethodNode mn : classNode.methods )
|
||||
{
|
||||
if( mn.name.equals( "func_146977_a" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(Lzk;)V" ) ) )
|
||||
{
|
||||
MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS );
|
||||
final MethodNode newNode = new MethodNode( Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS );
|
||||
newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 0 ) );
|
||||
newNode.instructions.add( new VarInsnNode( Opcodes.ALOAD, 1 ) );
|
||||
newNode.instructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, classNode.name, mn.name, mn.desc, false ) );
|
||||
@@ -104,17 +104,17 @@ public final class ASMTweaker implements IClassTransformer
|
||||
}
|
||||
}
|
||||
|
||||
for( MethodNode mn : classNode.methods )
|
||||
for( final MethodNode mn : classNode.methods )
|
||||
{
|
||||
if( mn.name.equals( "func_73863_a" ) || mn.name.equals( "drawScreen" ) || ( mn.name.equals( "a" ) && mn.desc.equals( "(IIF)V" ) ) )
|
||||
{
|
||||
Iterator<AbstractInsnNode> i = mn.instructions.iterator();
|
||||
final Iterator<AbstractInsnNode> i = mn.instructions.iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
AbstractInsnNode in = i.next();
|
||||
final AbstractInsnNode in = i.next();
|
||||
if( in.getOpcode() == Opcodes.INVOKESPECIAL )
|
||||
{
|
||||
MethodInsnNode n = (MethodInsnNode) in;
|
||||
final MethodInsnNode n = (MethodInsnNode) in;
|
||||
if( n.name.equals( "func_146977_a" ) || ( n.name.equals( "a" ) && n.desc.equals( "(Lzk;)V" ) ) )
|
||||
{
|
||||
this.log( n.name + n.desc + " - Invoke Virtual" );
|
||||
@@ -128,21 +128,21 @@ public final class ASMTweaker implements IClassTransformer
|
||||
}
|
||||
}
|
||||
|
||||
ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS );
|
||||
final ClassWriter writer = new ClassWriter( ClassWriter.COMPUTE_MAXS );
|
||||
classNode.accept( writer );
|
||||
return writer.toByteArray();
|
||||
}
|
||||
}
|
||||
catch( Throwable ignored )
|
||||
catch( final Throwable ignored )
|
||||
{
|
||||
}
|
||||
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
private void makePublic( ClassNode classNode, PublicLine set )
|
||||
private void makePublic( final ClassNode classNode, final PublicLine set )
|
||||
{
|
||||
for( MethodNode mn : classNode.methods )
|
||||
for( final MethodNode mn : classNode.methods )
|
||||
{
|
||||
if( mn.name.equals( set.name ) && mn.desc.equals( set.desc ) )
|
||||
{
|
||||
@@ -152,7 +152,7 @@ public final class ASMTweaker implements IClassTransformer
|
||||
}
|
||||
}
|
||||
|
||||
private void log( String string )
|
||||
private void log( final String string )
|
||||
{
|
||||
FMLRelaunchLog.log( "AE2-CORE", Level.INFO, string );
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public final class ASMTweaker implements IClassTransformer
|
||||
private final String name;
|
||||
private final String desc;
|
||||
|
||||
public PublicLine( String name, String desc )
|
||||
public PublicLine( final String name, final String desc )
|
||||
{
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
|
||||
Reference in New Issue
Block a user