Skip to content

Commit

Permalink
fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
xsun2001 committed Mar 23, 2017
1 parent e58f2a3 commit aec886a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/appeng/transformer/asm/ApiRepairer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import appeng.helpers.Reflected;
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.launchwrapper.LaunchClassLoader;
import org.apache.logging.log4j.Level;

import java.net.URL;
Expand All @@ -37,8 +38,11 @@
public class ApiRepairer implements IClassTransformer
{

private LaunchClassLoader launchClassLoader;

public ApiRepairer()
{
launchClassLoader = (LaunchClassLoader) this.getClass().getClassLoader();
FMLRelaunchLog.log( "AE2-ApiRepairer", Level.INFO, "AE2 ApiFixer Installed" );
}

Expand All @@ -59,11 +63,13 @@ public ApiRepairer()
FMLRelaunchLog.log( "AE2-ApiRepairer", Level.ERROR, "Failed to fix api class [%s] because the new class couldn't be read", transformedName );
return basicClass;
}
else
for( IClassTransformer ct : launchClassLoader.getTransformers() )
{
FMLRelaunchLog.log( "AE2-ApiRepairer", Level.INFO, "Successfully fix api class [%s]", transformedName );
return bytes;
if( ct == this )
continue;
bytes = ct.transform( name, transformedName, bytes );
}
return bytes;
}
catch( Exception e )
{
Expand Down

0 comments on commit aec886a

Please sign in to comment.