Posted July 17, 201411 yr Hi, I'm pretty sure I need to replace a method in the World class, seeing as I don't know how else to do it. I know ASM is used to make methods public, but it can also modify/replace the method itself? I've looked here for an idea on how to do it, but EventTransformer does not exist in 1.7.10. So do any of you know of a tutorial that can still be used in 1.7.10? Kain
July 17, 201411 yr ASM means Access Modifyer. Only for making methods public. And its for only coremod anyway. You should use Reflection. It can do what you want and its not too hard.
July 17, 201411 yr ASM means Access Modifyer. Only for making methods public. And its for only coremod anyway. You should use Reflection. It can do what you want and its not too hard. What you're referring to are ATs (Access Transformers). ASM can be used to all kinds of bytecode manipulations, even go as far as removing or replacing entire classes with custom code. ASM is only available for coremods and you need to know how to write code in ASM. ATs on the other hand can be utilized by any other mod, IIRC since recent versions of Forge. 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.
July 17, 201411 yr Author Are there any tutorials that cover creating a coremod and writing in ASM? Kain
July 18, 201411 yr Here's a tutorial which looks helpful: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editing Here's my coremod (updated to 1.7.10) if you want to have a reference: https://github.com/SanAndreasP/SAPManagerPack By the way, in my loading plugin class I have a @SortingIndex annotation. It makes it so that the coremod is loaded after Forge, thus you can use SRG names (like func_xxxxx_x or field_xxxxx_x) instead of worrying about the notched (like abc.a) names. 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.
July 18, 201411 yr What you're referring to are ATs (Access Transformers). Sorry i just switched it by accident. Thanks for telling that!
July 18, 201411 yr Author I'm replacing the computeLightValue method in the World class. What I'm trying to accomplish is adding a new check for how many solid blocks and air blocks stand inbetween the the block it's computing the light value for and the block at the top that can see the sky. Then I'll use that information to somehow alter the light value so that something floating high above the air won't cast the largest shadow on earth. Kain
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.