FINALLY got ASM working. You may now test the mod outside of eclipse!

This commit is contained in:
Adubbz 2014-10-05 16:53:00 +11:00
parent 65b3c1a701
commit 94df3fb688
3 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ public class ASMUtil
public static byte[] getBytes(ClassNode classNode)
{
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
ClassWriter writer = new ClassWriter(0);
classNode.accept(writer);
return writer.toByteArray();

View File

@ -11,8 +11,10 @@ package biomesoplenty.asm;
import java.util.Map;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
//TODO: Remove this or the BOPTransformer. It shouldn't be needed.
@TransformerExclusions("biomesoplenty.asm")
public class BOPLoadingPlugin implements IFMLLoadingPlugin
{
@Override

View File

@ -52,10 +52,8 @@ public class BOPTransformer implements IClassTransformer
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass)
{
if (name.equals("net.minecraft.client.resources.model.ModelBakery") || name.equals("cxh"))
if (name.equals(modelBakeryName.replace("/", ".")))
{
System.out.println("Tweaking ModelBakery...");
ClassNode classNode = ASMUtil.getClassNode(basicClass);
MethodNode variantsMethodNode = ASMUtil.getMethodNode(classNode, registerVariantNamesName, "()V");