diff --git a/.gitignore b/.gitignore index 14075d9..da61aad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /*.bat /forge /bin -/download \ No newline at end of file +/download +/.project +/.classpath diff --git a/alicefixes/src/com/skcraft/alicefixes/AliceFixes.java b/alicefixes/src/com/skcraft/alicefixes/AliceFixes.java index 066210d..3614e5d 100644 --- a/alicefixes/src/com/skcraft/alicefixes/AliceFixes.java +++ b/alicefixes/src/com/skcraft/alicefixes/AliceFixes.java @@ -4,7 +4,7 @@ import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -@Mod(modid = "aliceFixes", version = "0.1.0") +//@Mod(modid = "aliceFixes", version = "0.1.0") public class AliceFixes { @PreInit diff --git a/alicefixes/src/com/skcraft/alicefixes/AliceTransformer.java b/alicefixes/src/com/skcraft/alicefixes/AliceTransformer.java index 2f1bb4c..3c35b7d 100644 --- a/alicefixes/src/com/skcraft/alicefixes/AliceTransformer.java +++ b/alicefixes/src/com/skcraft/alicefixes/AliceTransformer.java @@ -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 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; } - } diff --git a/alicefixes/src/com/skcraft/alicefixes/LoadingPlugin.java b/alicefixes/src/com/skcraft/alicefixes/LoadingPlugin.java index 76e7c28..4cb8647 100644 --- a/alicefixes/src/com/skcraft/alicefixes/LoadingPlugin.java +++ b/alicefixes/src/com/skcraft/alicefixes/LoadingPlugin.java @@ -30,16 +30,4 @@ public String getSetupClass() { @Override public void injectData(Map data) {} - - public static String[] getTransformers() { - return new String[] { "com.skcraft.alicefixes.TransformMiningLaser", - "com.skcraft.alicefixes.TransformBlockBreaker" - /*"com.skcraft.alicefixes.TransformIC2Explosions", - "com.skcraft.alicefixes.TransformTCExcWand", - "com.skcraft.alicefixes.TransformTCEquWand", - "com.skcraft.alicefixes.TransformTCFrostWand", - "com.skcraft.alicefixes.TransformTCAxe", - "com.skcraft.alicefixes.TransformTCShovel"*/}; - } - } diff --git a/alicefixes/src/com/skcraft/alicefixes/ObfNames.java b/alicefixes/src/com/skcraft/alicefixes/ObfNames.java index d56e443..a3fef39 100644 --- a/alicefixes/src/com/skcraft/alicefixes/ObfNames.java +++ b/alicefixes/src/com/skcraft/alicefixes/ObfNames.java @@ -2,8 +2,8 @@ public class ObfNames { - public static final String ENTITY_LIVING = "md"; - public static final String ENTITY = "lq"; - public static final String TILE_ENTITY = "any"; + public static final String ENTITY_LIVING = "ng"; + public static final String ENTITY = "mp"; + public static final String TILE_ENTITY = "aqp"; } diff --git a/alicefixes/src/com/skcraft/alicefixes/TransformBlockBreaker.java b/alicefixes/src/com/skcraft/alicefixes/TransformBlockBreaker.java index cc17f67..54a461d 100644 --- a/alicefixes/src/com/skcraft/alicefixes/TransformBlockBreaker.java +++ b/alicefixes/src/com/skcraft/alicefixes/TransformBlockBreaker.java @@ -22,10 +22,11 @@ import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.IClassTransformer; +// THIS MAY NOT WORK WHEN THE NEW RP COMES OUT (if it ever does...) public class TransformBlockBreaker implements IClassTransformer { @Override - public byte[] transform(String name, byte[] bytes) { + public byte[] transform(String name, String transformedName, byte[] bytes) { if(name.equals("com.eloraam.redpower.machine.TileBreaker")) { return handleBreakerTransform(bytes); } diff --git a/alicefixes/src/com/skcraft/alicefixes/TransformMiningLaser.java b/alicefixes/src/com/skcraft/alicefixes/TransformMiningLaser.java index 4d528fd..6e96cda 100644 --- a/alicefixes/src/com/skcraft/alicefixes/TransformMiningLaser.java +++ b/alicefixes/src/com/skcraft/alicefixes/TransformMiningLaser.java @@ -34,13 +34,13 @@ public class TransformMiningLaser implements IClassTransformer{ private final String MINE_METHOD_NAME = "canMine"; @Override - public byte[] transform(String name, byte[] bytes) { + public byte[] transform(String name, String transformedName, byte[] bytes) { if(name.equals(LASER_CLASS_NAME)) { return handleLaserTransform(bytes); } return bytes; } - + private byte[] handleLaserTransform(byte[] bytes) { ClassNode classNode = new ClassNode(); diff --git a/build.xml b/build.xml index df323a4..dfe66ca 100644 --- a/build.xml +++ b/build.xml @@ -7,9 +7,9 @@ - - - + + + @@ -33,7 +33,7 @@ - + @@ -68,10 +68,10 @@ - + - + @@ -86,7 +86,6 @@ -