Darkhax-Minecraft / Bookshelf

A library mod which adds additional code support beyond what is provided by Forge.
GNU Lesser General Public License v2.1
142 stars 39 forks source link

java.lang.IllegalAccessError #109

Closed shelbykauth closed 5 years ago

shelbykauth commented 5 years ago

Hello there. I'm currently trying to write my own mod and was going to use the Guidebook API for, well, making a guidebook. And that depends on this. But when I include guidebook in my build.gradle, the client crashes. I know it didn't at one point, and then it started to. I went back and commented out most of my changes that I had made after, and it still crashes. I'm not sure what's going on or how I can fix it. The only thing that works currently is removing the dependency and continuing to mod without it.

My Crash Report

` ---- Minecraft Crash Report ---- // I bet Cylons wouldn't have this problem.

Time: 10/7/18 2:04 PM Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Bookshelf (bookshelf) Caused by: java.lang.IllegalAccessError: tried to access field net.minecraft.client.resources.I18n.i18nLocale from class net.darkhax.bookshelf.client.RomanNumerals at net.darkhax.bookshelf.client.RomanNumerals.mapLevels(RomanNumerals.java:50) at net.darkhax.bookshelf.client.RomanNumerals.insertRomanNumerals(RomanNumerals.java:43) at net.darkhax.bookshelf.Bookshelf.onLoadComplete(Bookshelf.java:130) 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:629) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) 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) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) 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) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:752) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:329) at net.minecraft.client.Minecraft.init(Minecraft.java:581) at net.minecraft.client.Minecraft.run(Minecraft.java:421) at net.minecraft.client.main.Main.main(Main.java:118) 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.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_181, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 808811616 bytes (771 MB) / 1777860608 bytes (1695 MB) up to 3793747968 bytes (3618 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.4.2705 19 mods loaded, 19 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

| State   | ID                  | Version        | Source                                  | Signature                                |
|:------- |:------------------- |:-------------- |:--------------------------------------- |:---------------------------------------- |
| UCHIJA  | minecraft           | 1.12.2         | minecraft.jar                           | None                                     |
| UCHIJA  | mcp                 | 9.42           | minecraft.jar                           | None                                     |
| UCHIJA  | FML                 | 8.0.99.99      | forgeSrc-1.12.2-14.23.4.2705.jar        | None                                     |
| UCHIJA  | forge               | 14.23.4.2705   | forgeSrc-1.12.2-14.23.4.2705.jar        | None                                     |
| UCHIJA  | gbook               | 2.8.3          | Guidebook-1.12.2-2.8.3.jar              | None                                     |
| UCHIJEE | bookshelf           | 2.3.552        | Bookshelf-1.12.2-2.3.552.jar            | None                                     |
| UCHIJ   | gamestages          | 2.0.91         | GameStages-1.12.2-2.0.91.jar            | None                                     |
| UCHIJ   | apothecary          | 1.12.2-0.0.0.0 | apothecary-1.12.2-0.0.0.0.jar           | None                                     |
| UCHIJ   | computercraft       | 1.80pr1.7      | cc-tweaked-1.80pr1.7.jar                | None                                     |
| UCHIJ   | guideapi            | 1.12-2.1.5-60  | Guide-API-1.12-2.1.5-60.jar             | None                                     |
| UCHIJ   | jei                 | 4.11.0.202     | jei_1.12.2-4.11.0.202.jar               | None                                     |
| UCHIJ   | jeiintegration      | 1.5.1.36       | jeiintegration_1.12.2-1.5.1.36.jar      | None                                     |
| UCHIJ   | jeivillagers        | 1.0            | jeivillagers-1.12-1.0.2.jar             | None                                     |
| UCHIJ   | jepb                | 1.2.1          | jepb-1.12-1.2.1.jar                     | None                                     |
| UCHIJ   | jeresources         | 0.8.5.27       | JustEnoughResources-1.12.2-0.8.5.27.jar | None                                     |
| UCHIJ   | plethora-core       | 1.1.12         | plethora-1.12.2-1.1.12.jar              | None                                     |
| UCHIJ   | plethora            | 1.1.12         | plethora-1.12.2-1.1.12.jar              | None                                     |
| UCHIJ   | wailaharvestability | 1.1.12         | WailaHarvestability-mc1.12-1.1.12.jar   | None                                     |
| UCHIJ   | wawla               | 2.5.257        | Wawla-1.12.2-2.5.257.jar                | d476d1b22b218a10d845928d1665d45fce301b27 |

Loaded coremods (and transformers): 
GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4835' Renderer: 'Intel(R) HD Graphics 4600'

`

My build.gradle file

buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.

version = "1.12.2-0.0.0.0" group = "thornecraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "apothecary"

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' }

minecraft { version = "1.12.2-14.23.4.2705" runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD   snapshot are built nightly.
// stable_#            stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "stable_39"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

} repositories { maven { url 'http://dogforce-games.com/maven' } maven { url 'https://maven.mcmoddev.com' } } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version"

// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
compile "gigaherz.commons:gigaherz.commons-1.12.1:0.6.4"
compile "gigaherz.guidebook:Guidebook-1.12.2:2.8.3"

}

processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
    include 'mcmod.info'

    // replace version and mcversion
    expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
    exclude 'mcmod.info'
}

}

Darkhax commented 5 years ago

How are you instaling Bookshelf? It needs to be done through the libs forlder, or by adding it as a dependency in the build.gradle.

shelbykauth commented 5 years ago

build.gradle dependencies { compile "gigaherz.commons:gigaherz.commons-1.12.1:0.6.4" compile "gigaherz.guidebook:Guidebook-1.12.2:2.8.3" }

And Guidebook in turn depends on Bookshelf and GameStages. Sorry for the messy post, I tried putting it in code tags but Github apparently didn't like how I tried to do so...

Darkhax commented 5 years ago

You can try setting useDepAts = true in the minecraft block, however this shouldn't be required.

gigaherz commented 5 years ago

Hey this is a long shot but: In the past I had to add my "commons" library to the readme, because people were having issues with forgegradle not properly processing transitive dependencies. You may want to explicitly include GameStages and Bookshelf in the list of dependencies.

Also do note you used compile, instead of deobfCompile. You will probably need to use deobfCompile for all of them.

See: https://github.com/gigaherz/Guidebook/blob/master/build.gradle#L51,L52