Posted March 24, 201411 yr 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 *
March 25, 201411 yr 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?
March 25, 201411 yr 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 } }
March 27, 201411 yr Author The wiki (http://www.minecraftforge.net/wiki/Using_Access_Transformers) says nothing about IFMLLoadingPlugin in 1.7/1.6 ?! And if I understood right, Access Transformers are senseless for compiled minecraft, or aren't they?
March 27, 201411 yr 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.