Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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.

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.

  • Author

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'
    }
}

 

  • Author

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();
}
}

 

  • Author

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

 

  • Author

People on the IRC helped me out, I needed a Core container. Thanks for the GitHub link though, it really helped!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.