Jump to content

Access Transformers 1.7.10 ['SOLVED' i.e. used reflection instead]


TheGreyGhost

Recommended Posts

Hi

 

Could anyone point me towards a mod on GitHub or similar which uses Access Transformers? (private ->public for a field)

 

I've created an access transformer config file and it worked fine for the dev workspace but when I build to a jar and load it in a release environment, the field is still private.

 

I am about ready to explode trying to get them to work; I am using the FMLAT META-INF method, and FML is loading the rules ok but it just doesn't seem to apply them no matter what combinations I try. 

 

Based on the logs I know it's loading the three rules out of the access transformer file, and they are parsing correctly.  But it seems they are silently not applying.

 

Further information:

If I create a new Forge development environment, place my released mod into the eclipse/mods folder, then debug or run, it applies the access transformation no problem.  (It crashes soon after because all the names are obfuscated, but that's not the point...)

 

Some relevant error logs

 

 

the field I'm trying to modify in KeyBinding is keybindArray (field_74516_a)

@SideOnly(Side.CLIENT)
public class KeyBinding implements Comparable
{
    private static final List keybindArray = new ArrayList();
  ... snip ...

 

my access_transformer file, trying a few different rules

public net.minecraft.client.settings.KeyBinding * # All fields
public net.minecraft.client.settings.KeyBinding field_74516_a # srg name
public net.minecraft.client.settings.KeyBinding keybindArray # deobfs name

 

the error:

cpw.mods.fml.common.LoaderException: java.lang.IllegalAccessError: tried to access field net.minecraft.client.settings.KeyBinding.field_74516_a from class speedytools.clientside.userinput.KeyBindingInterceptor
at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)

 

from fml-client-latest.log with -Dfml.debugAccessTransformer=true

[13:34:14] [main/DEBUG] [FML/]: Examining for coremod candidacy speedytoolsmod-2.0.0.jar
[13:34:14] [main/DEBUG] [FML/]: Loaded 3 rules from AccessTransformer mod jar file C:\Documents and Settings\TGG\My Documents\MineCraft\mods\test\mods\speedytoolsmod-2.0.0.jar

[13:34:14] [main/DEBUG] [FML/]: Not found coremod data in speedytoolsmod-2.0.0.jar
[13:34:14] [main/INFO] [LaunchWrapper/]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

... snip...

[13:34:20] [Client thread/DEBUG] [FML/]: Considering all methods and fields on net.minecraft.client.audio.SoundCategory (w)

[13:34:20] [Client thread/DEBUG] [FML/]: Considering all methods and fields on net.minecraft.client.settings.KeyBinding (bal)

[13:34:20] [Client thread/DEBUG] [FML/]: Considering all methods and fields on net.minecraft.client.settings.KeyBinding (bal)

[13:34:20] [Client thread/DEBUG] [FML/]: Considering all methods and fields on net.minecraft.client.settings.KeyBinding (bal)

[13:34:20] [Client thread/DEBUG] [FML/]: Considering all methods and fields on net.minecraft.util.IntHashMap (pz)

 

from the console output with -Dfml.debugAccessTransformer=true

AT RULE: 0000000000000001 *  (type net.minecraft.client.settings.KeyBinding)
AT RULE: 0000000000000001 field_74516_a  (type net.minecraft.client.settings.KeyBinding)
AT RULE: 0000000000000001 keybindArray  (type net.minecraft.client.settings.KeyBinding)

 

If I create a new Forge development environment, place my released mod into the eclipse/mods folder, then debug or run:

[20:03:17] [Client thread/INFO] [sTDOUT]: [cpw.mods.fml.common.asm.transformers.AccessTransformer:transform:211]: Field: net.minecraft.client.settings.KeyBinding.keybindArray 0000000000011010 -> 0000000000011001

 

 

 

-TGG

 

 

Link to comment
Share on other sites

Well I've spat the dummy and used Reflection get and set instead.  After a bit more testing I'm reasonably sure it's an FML bug related to (re)obfuscation, but maybe that's just sour grapes talking.

 

Anyway I don't need the access transformers any more.  If you know what went wrong, I'm interested to hear, but don't waste time trying to figure it out for my sake:)

 

-TGG

Link to comment
Share on other sites

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.