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

I am trying to modify a method in FirstPersonRenderer.

Since it is not declared as a field in many classes, I chose to use reflection rather than coremod.

I have a method shown below in my class that extends FirstPersonRenderer.

public static void patch() {
    FirstPersonRenderer instance = new FirstPersonRenderer(Minecraft.getInstance());
    ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, Minecraft.getInstance(), instance, "field_175620_Y");
    ObfuscationReflectionHelper.setPrivateValue(GameRenderer.class, Minecraft.getInstance().gameRenderer, instance, "field_78516_c");
    ObfuscationReflectionHelper.setPrivateValue(GameRenderer.class, ObfuscationReflectionHelper.getPrivateValue(LightTexture.class, Minecraft.getInstance().gameRenderer.getLightTexture(), "field_205116_g"), instance, "field_78516_c");
}

Is it correct that I cannot call this method in main class when FMLClientSetupEvent is fired as it accesses client only classes?

If so, how can I apply these patches correctly?

  • Author
4 minutes ago, loordgek said:

what are you trying to do

I am trying to recreate sword blocking and it requires me to modify renderItemInFirstPerson method which is private.

Just add a propertyOverride to your Item and change the position that way

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

  • Author
5 hours ago, _Cruelar_ said:

Just add a propertyOverride to your Item and change the position that way

I also have considered that but I wanted to use exact values that were used before 1.9 and I do not know how should I change those values to fit in JSON.

Maybe try looking at shield_blocking.json or try applying the patches in your ClientProxy which should be Client-only, however note that any change to these should also be done in Client-only classes/methods

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

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.