Jump to content

[1.7.2] Access Transfomers not being applied when building a release version


Recommended Posts

Posted

Hey,

 

I have been using access transformers for the past month without problems, until about a week ago.

They still work fine for my workspace but when I try to build a release version they don't get applied anymore.

When I start Minecraft with my mod loaded (and enter a world) the mod tries to access Minecraft.timer and errors out.

 

Here is what my AT looks like:

 

public net.minecraft.client.Minecraft field_71428_T						# Minecraft.timer

public net.minecraft.client.renderer.ActiveRenderInfo field_74594_j		# ActiveRenderInfo.modelview
public net.minecraft.client.renderer.ActiveRenderInfo field_74595_k		# ActiveRenderInfo.projection

 

 

I'm not sure wether I am straight up missing something but.. this is rather odd.

Posted

Can we see your build.gradle file?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Here you go:

 

 

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.0"
group= "com.luastoned.luacraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "luacraft"

minecraft {
    version = "1.7.2-10.12.1.1060"
    assetDir = "eclipse/assets"
}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

Posted

You need to be a coremod (implement IFMLLoadingPlugin, etc.) for your ATs to apply at runtime.

 

Yeah I do have those, though I'm not sure if I am using them right.

 

 

package com.luacraft.asm;

import java.io.IOException;
import cpw.mods.fml.common.asm.transformers.AccessTransformer;

public class LuaCraftAccessTransformer extends AccessTransformer
{
public LuaCraftAccessTransformer() throws IOException {
	super("luacraft_at.cfg");
}
}

 

 

 

package com.luacraft.asm;

import java.util.Map;
import com.luacraft.LuaCraft;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

public class LuaCraftLoader implements IFMLLoadingPlugin
{
@Override
public String[] getASMTransformerClass() {
	return new String[0];
}

@Override
public String getModContainerClass() {
	return LuaCraft.class.getName();
}

@Override
public String getSetupClass() {
	return null;
}

@Override
public void injectData(Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
	return LuaCraftAccessTransformer.class.getName();
}
}

 

Posted

Well,  I thought that would work but now I'm getting this error:

cpw.mods.fml.common.LoaderException: java.lang.ClassCastException: com.luacraft.LuaCraft cannot be cast to cpw.mods.fml.common.ModContainer
at cpw.mods.fml.common.Loader.identifyMods(Loader.java:326)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:465)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:202)
	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:465)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:813)
at net.minecraft.client.main.Main.main(SourceFile:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.ClassCastException: com.luacraft.LuaCraft cannot be cast to cpw.mods.fml.common.ModContainer

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.