FINALLY got ASM working. You may now test the mod outside of eclipse!
This commit is contained in:
parent
65b3c1a701
commit
94df3fb688
3 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ public class ASMUtil
|
||||||
|
|
||||||
public static byte[] getBytes(ClassNode classNode)
|
public static byte[] getBytes(ClassNode classNode)
|
||||||
{
|
{
|
||||||
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
|
ClassWriter writer = new ClassWriter(0);
|
||||||
classNode.accept(writer);
|
classNode.accept(writer);
|
||||||
|
|
||||||
return writer.toByteArray();
|
return writer.toByteArray();
|
||||||
|
|
|
@ -11,8 +11,10 @@ package biomesoplenty.asm;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||||
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
|
||||||
|
|
||||||
//TODO: Remove this or the BOPTransformer. It shouldn't be needed.
|
//TODO: Remove this or the BOPTransformer. It shouldn't be needed.
|
||||||
|
@TransformerExclusions("biomesoplenty.asm")
|
||||||
public class BOPLoadingPlugin implements IFMLLoadingPlugin
|
public class BOPLoadingPlugin implements IFMLLoadingPlugin
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,10 +52,8 @@ public class BOPTransformer implements IClassTransformer
|
||||||
@Override
|
@Override
|
||||||
public byte[] transform(String name, String transformedName, byte[] basicClass)
|
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);
|
ClassNode classNode = ASMUtil.getClassNode(basicClass);
|
||||||
MethodNode variantsMethodNode = ASMUtil.getMethodNode(classNode, registerVariantNamesName, "()V");
|
MethodNode variantsMethodNode = ASMUtil.getMethodNode(classNode, registerVariantNamesName, "()V");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue