Posted February 3, 201411 yr I had already read this tutorial about access transformer(http://www.minecraftforge.net/wiki/Using_Access_Transformers), it only told me how to change modifiers of fields or methods by using "*_at.cfg" , not using a Class which extends from AccessTransformer . Previously, the file "META-INF\MANIFEST.MF" can help forge to find the transformer class. But now, it didn't work. The codes in transformer class has never been run. I'm really confused. I'm hoping someone can help me to figure it out. thanks
February 3, 201411 yr The manifest should point to your IFMLLoadingPlugin implementation. This interface changed recently with a new direct getter for the access transformer class. Given the way AccessTransformer is written, it is meant to point at the file passed through its constructor. Thus you only need to do that. IClassTransformer implementations are still loaded the same as before.
February 4, 201411 yr Author I'm now running atomicstryker's simplyhax source code for transformer testing in IntelliJ with minecraft 1.7.2 workspace. I think I do the right things. Here is the MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.4 Created-By: 1.7.0 (Oracle Corporation) FMLCorePlugin: atomicstryker.simplyhax.SHFMLCorePlugin And SHFMLCorePlugin.java package atomicstryker.simplyhax; import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; public class SHFMLCorePlugin implements IFMLLoadingPlugin { @Override public String[] getASMTransformerClass() { return new String[] { "atomicstryker.simplyhax.SHTransformer" }; } @Override public String getModContainerClass() { return null; } @Override public String getSetupClass() { return null; } @Override public void injectData(Map<String, Object> data) { } @Override public String getAccessTransformerClass() { return null; } } SHTransformer.java public class SHTransformer implements IClassTransformer { /* class net.minecraft.src.EntityPlayerSP */ private final String classNamePlayerObfusc = "bex"; private final String classNamePlayer = "net.minecraft.client.entity.EntityPlayerSP"; @Override public byte[] transform(String name, String newName, byte[] bytes) { System.out.println("transforming: "+name); // I saw nothing about transforming in output window. if (name.equals(classNamePlayerObfusc)) { return handleTransform(bytes, true); } else if (name.equals(classNamePlayer)) { return handleTransform(bytes, false); } return bytes; }
February 4, 201411 yr Where is the jar with your manifest ? It should be in eclipse/mods by default. You can also change the run configuration to load the "loadingplugin" directly.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.