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 tried to update my mod from 1.6.4 where I used Java Reflection to access the protected field GuiScreen.buttonList

to 1.7.2 where I decided to switch to access transformers for performance (and compatibility)

 

I added a *_at.cfg to ressources folder and re-setup the gradlew stuff and now in the eclipse environment everything works fine and everything is public :)

 

But when I built the jar and tried running it in a not-dev-environment (normal minecraft) I get this error:

java.lang.IllegalAccessError: tried to access field net.minecraft.client.gui.GuiScreen.field_146292_n from class tennox.customselectionbox.CSBClientProxy
at tennox.customselectionbox.CSBClientProxy.onTick(CSBClientProxy.java:31)

 

 

 

Edit:

tennox_customselectionbox_at.cfg:

public net.minecraft.client.gui.GuiScreen *

  • Author

Do you have your Coremod stuff setup? (IFMLLoadingPlugin and the like?)

 

I have to admit I did forget that... (Will try with that, but if Access Transformers aren't better, I would like to try with reflection)

But to the reflection stuff: It works fine in the decompiled environment, but when build I get this error:

[17:46:06 INFO]: Client> java.lang.NoSuchFieldException: buttonList
[17:46:06 INFO]: Client> 	at java.lang.Class.getDeclaredField(Unknown Source)

 

My Code:

Field field = guioptions.getClass().getSuperclass().getDeclaredField("buttonList");
field.setAccessible(true);
List buttons = field.get(guioptions)

 

I thought Minecraft is decompiled at runtime? Also it said in the Wiki (http://www.minecraftforge.net/wiki/Using_Access_Transformers):

the naming convention should be srg names and Forge packages

 

What did I understand wrong here?

Did you check your *at.cfg file is in your built mod jar ?

You also need your manifest file to point to your IFMLLoadingPlugin.

 

jar {
    // Add Coremod Manifest
    manifest {
        attributes 'FMLCorePlugin': "loadingPlugin.classpath"//to be replaced by the correct classpath
        attributes 'FMLCorePluginContainsFMLMod': true//If you want that too
    }
}

 

  • Author

The tutorial is a bit unclear. You still need the coremod stuff, it is what makes the modifications work in the compiled minecraft (for the end-user, outside the development environment).

For your development environment, ForgeGradle applies the modifications directly.

 

Too complicated for what I want, just using Reflection now :)

 

Thanks!

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.