OK, I have managed to get it working.
It's really confusing.
I had problems with ClassWriter.COMPUTE_FRAMES (only in release environment)
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
after changing it to
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
it worked fine, but I'm not sure if it is right?
Another thing is the obstructed classes, I have it hard-coded now, is there any API for getting the deobstructed - obstructed names?
Or is there a common way of doing ASM stuff in forge? I was looking around but couldn't find anything.
Also I have a question about reflection, the following code gives me exceptions (in dev environment):
Class<?> EntityLivingClass = Class.forName("net.minecraft.entity.EntityLiving");
EntityLiving_isPlayer = EntityLivingClass.getDeclaredMethod("isPlayer");
(It works if I use the methods normally and move the class into net.minecraft.entity, but then forge complains)
I was looking around and found info that it is recommended to use reflection instead of Access Transformers.
The question is: is there a common API for reflection in forge?