Posted December 16, 20204 yr On 1.15.2 - 31.2.0 mod runs fine in dev environment, but fails at the first of the following lines during common_setup event phase. If the first line is omitted, it fails on the second, indicating a general problem with symbol lookup in the runtime only environment: this.updateAutoJump = ObfuscationReflectionHelper.findMethod(ClientPlayerEntity.class, "updateAutoJump", float.class, float.class); this.mouseButtonSimulate = ObfuscationReflectionHelper.findMethod(MouseHelper.class, "mouseButtonCallback", long.class, int.class, int.class, int.class); The relevant part of build.gradle: minecraft { [...] mappings channel: 'snapshot', version: '20201216-1.15.1' //mappings channel: 'snapshot', version: '20200514-1.15.1' // also doesn't work [...] } Has anyone else encountered this problem? Have researched for a day now, and just cannot see why the SRG names are not being consistently handled by ObfuscationReflectionHelper Any help greatly appreciated
December 17, 20204 yr Author On 12/16/2020 at 1:27 PM, diesieben07 said: You have to give ObfuscationReflectionHelper the SRG names, not the MCP names. Got it working. Thanks for clearing up some confusion for this noob. In case anyone else finds it useful, the SRG names are the cryptic kind, eg func_189810_i The dev environment will also accept human-friendly MCP names as ObfuscationReflectionHelper arguments, eg updateAutoJump The runtime-only environment (ie, during normal use) only works if ObfuscationReflectionHelper has SRG name arguments. My working code now looks like: this.updateAutoJump = ObfuscationReflectionHelper.findMethod(ClientPlayerEntity.class, "func_189810_i", // func_189810_i = updateAutoJump float.class, float.class); this.mouseButtonSimulate = ObfuscationReflectionHelper.findMethod(MouseHelper.class, "func_198023_a", // func_198023_a = mouseButtonCallback long.class, int.class, int.class, int.class); Useful links: MCP, environments and naming Tool for looking up SRG names
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.