Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.