Jump to content

[Solved]IllegalAccessError with `gradlew runClient` when using other mods as dependencies


Recommended Posts

Posted (edited)

I think there's something fundamentally I don't understand.:(

I'm playing around with Botania and in my project I want to include it (and baubles) as dependencies. What I did is putting the de-obfuscate jars of these 2 mods into libs dir. From what I read this should be sufficient to include a mod as dependency. However when I run `gradlew runClient` the game crashes with java.lang.IllegalAccessError. The version I use of botania is r1.10-353 and baubles 1.5.2.

The first time it crash with forge 14.23.1.2607 (as of writing the newest), which happens at botania somewhere in a renderWandModeDisplay method of HUDHandler.java, its trying to access `remainingHighlightTicks` field in GuiIngame class. The behavior is whenever I try to select "wand of forest" in my toolbar mc crashes. I looked it up in intellij IDEA and found it is a protect field. So the crash makes sense.

Initially I thought it is because of forge version mismatch so I tried to use version 2555, and now it crashes even when loading, also IllegalAccessError.

Spoiler

Caused by: java.lang.IllegalAccessError: tried to access method net.minecraft.advancements.CriteriaTriggers.register(Lnet/minecraft/advancements/ICriterionTrigger;)Lnet/minecraft/advancements/ICriterionTrigger; from class vazkii.botania.common.Botania
    at vazkii.botania.common.Botania.preInit(Botania.java:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:608)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)

......

From what I see in IDE `register` is a private static method.

 

I cloned botania's source from github which uses 2555 build version, import as a new project and everything seems to be fine. What confuses me most is in this project if I jump to the above two spots those fields are public!

does botania modified the way how forge source generated? Or is there something I did wrong? (basically all I do after unzipping is, copy all files begin with gradle, build.gradle and gitignore to an empty folder, run `setupDecompWorkspace` and `build`, import build.gradle into intellij IDEA and run `genIntellijRuns`). I really hope someone could clear my doubts. Also, in this scenario what should I do to use botania as dependency and not crashing?

Edited by Frefreak

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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