Jump to content

Using access transformers


Lunakki

Recommended Posts

I went through the tutorial on using access transformers, but I'm still unsure on some things. Basically I want to make the field inGround in EntityArrow protected instead of private, so that subclasses can access it. The config file and all that makes enough sense, but what about the mod container? Do I need to move everything in my mod class (that sets the modID, declares all the new items, etc.) to that class? If so, where exactly do I put my code currently in postInit? The tutorial says to use @subscribe in place of @Postinit, and says to "make sure you use the right event", but what is the right event?

 

Do I even have to move anything? The class(es) that need access to inGround aren't explicitly a member of any particular mod, but I don't know what the purpose of the mod container class is. Is there some documentation somewhere that explains all that?

 

Thanks in advance for any help.

Link to comment
Share on other sites

I can help with the @forgesubscribe, just ensure that your postinit function has forgePostinitevent as an argument and that will work as your post init function.

 

check this out for a more update tutorial if you haven't

 

http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/

Link to comment
Share on other sites

I didn't see that tutorial yet; I was looking at the one on the wiki. That's really helpful.

 

Hmm.. it doesn't even mention making a mod container class for the access transformers. It only talks about it in a different section about making the mod show up in the mod list. Maybe that means I don't need to do it after all. I'll have to read that over some more and play with it.

 

Thanks!

Link to comment
Share on other sites

no, you don't need to move anything. you can still register your mod by using the @mod annotation and keep it separate from the ifmlloadingplugin. and i don't think you need an access transformer for that. i read somewhere that during runtime (in mc, after reobfuscating) everything's turned to public so all you need to do is change it to public in your dev env as well. i don't really know if absolutely everything is turned public (i doubt it) but i'm guessing a lot is. anyway, i used to use an access transformer for some stuff but after finding out that piece of information, i got rid of it and my mod still works fine.

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.