Posted May 27, 20196 yr 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 net.minecraft.entity.EntityLivingBase.func_184583_a() 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.
May 27, 20196 yr Author 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?
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.