Jump to content

ObfuscationReflectionHelper issues 1.2.12


Recommended Posts

I'm trying to use ObfuscationReflectionHelper.findMethod to get a base class method for my custom damage class, but when using the obfuscated name from the srg mappings file from gradle/cache it crashes saying the method doesn't exist. more specifically I'm using this 

ObfuscationReflectionHelper.findMethod(EntityLivingBase.class, "func_70097_a", boolean.class, DamageSource.class, float.class);

But since I'm using the correct name I would assume it's an issue with my understanding of the method. Does this only work once the mod is built, and assuming, its re-obfuscated? The crash report shows the normal package names, as in 


Am I supposed to supply the actual name of the method, as in attackEntityFrom?

Wondering if instead I should just restructure the code so I have a subclass of EntityLivingBase, instead of trying to invoke specific methods returned from ObfuscationReflectionHelper.findMethod


Bottom line, in what context is ObfuscationReflectionHelper used, and why does it error when searching for the correct mapping name.

Link to comment
Share on other sites

Y'know that's a good question. I am fairly new to forge modding, but I have some years of programming experience. I am currently updating and fixing a previous code base to work better with some custom integrations, and they are using the deprecated ReflectionHelper class in their custom damage class. Since it was just the first pass of updating the code base I was just making sure all the code was up to date. Guess I'll have to do some restructuring after all. Regardless, assuming that method was private, using the mapping name from gradle/cache should correctly return the method out of the dev environment?

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.

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.


  • Create New...

Important Information

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