-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
35 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
/*.bat | ||
/forge | ||
/bin | ||
/download | ||
/download | ||
/.project | ||
/.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 18 additions & 31 deletions
49
alicefixes/src/com/skcraft/alicefixes/AliceTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,35 @@ | ||
package com.skcraft.alicefixes; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.logging.Level; | ||
|
||
import cpw.mods.fml.common.FMLLog; | ||
import cpw.mods.fml.relauncher.IClassTransformer; | ||
|
||
public class AliceTransformer implements IClassTransformer { | ||
|
||
private final List<IClassTransformer> transformers; | ||
|
||
public AliceTransformer() { | ||
String[] names = LoadingPlugin.getTransformers(); | ||
transformers = new ArrayList(names.length); | ||
for(String transformer : names) { | ||
try { | ||
transformers.add((IClassTransformer)Class.forName(transformer).newInstance()); | ||
} | ||
catch(Throwable t) { | ||
t.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
|
||
private final IClassTransformer[] transformers = { | ||
new TransformMiningLaser()}; | ||
//new TransformBlockBreaker() | ||
//new TransformIC2Explosions(), | ||
//new TransformTCExcWand(), | ||
//new TransformTCEquWand(), | ||
//new TransformTCFrostWand(), | ||
//new TransformTCAxe(), | ||
//new TransformTCShovel()}; | ||
|
||
@Override | ||
public byte[] transform(String name, byte[] bytes) { | ||
public byte[] transform(String name, String transformedName, byte[] bytes) { | ||
|
||
if(bytes == null) { | ||
return bytes; | ||
} | ||
|
||
for(IClassTransformer transformer : transformers) { | ||
try { | ||
bytes = transformer.transform(name, bytes); | ||
if(bytes == null) | ||
FMLLog.log(Level.SEVERE, "Transformer " + transformer + " has corrupted class " + name); | ||
} | ||
catch(Throwable t) { | ||
t.printStackTrace(); | ||
} | ||
bytes = transformer.transform(name, transformedName, bytes); | ||
if(bytes == null) | ||
FMLLog.log(Level.SEVERE, "Transformer " + transformer + " has corrupted class " + name); | ||
} | ||
|
||
return bytes; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters