Jump to content

[1.8.9] [SOLVED] Really Weird Bug


yoshiquest

Recommended Posts

Ok, I began to port my mod to Minecraft 1.8.9, and this happened. I don't think you guys will be able to fix it, but I'll post it anyways.

 

Upon compiling the first time it works just fine, but compiling a second time causes a crash with the following error:

 

 

 

Exception in thread "main" java.lang.ExceptionInInitializerError

at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:128)

at net.minecraft.world.biome.BiomeGenBase.<init>(BiomeGenBase.java:163)

at net.minecraft.world.biome.BiomeGenOcean.<init>(BiomeGenOcean.java:11)

at net.minecraft.world.biome.BiomeGenBase.<clinit>(BiomeGenBase.java:73)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:340)

at clojure.lang.RT.classForName(RT.java:2168)

at clojure.lang.RT.classForName(RT.java:2177)

at forge_clj.registry__init.__init1(Unknown Source)

at forge_clj.registry__init.<clinit>(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:340)

at clojure.lang.RT.classForName(RT.java:2168)

at clojure.lang.RT.classForName(RT.java:2177)

at clojure.lang.RT.loadClassForName(RT.java:2196)

at clojure.lang.RT.load(RT.java:443)

at clojure.lang.RT.load(RT.java:419)

at clojure.core$load$fn__5677.invoke(core.clj:5893)

at clojure.core$load.invokeStatic(core.clj:5892)

at clojure.core$load.doInvoke(core.clj:5876)

at clojure.lang.RestFn.invoke(RestFn.java:408)

at clojure.core$load_one.invokeStatic(core.clj:5697)

at clojure.core$compile$fn__5682.invoke(core.clj:5903)

at clojure.core$compile.invokeStatic(core.clj:5903)

at clojure.core$compile.invoke(core.clj:5895)

at clojuresque.tasks.compile$eval41$main_task_driver__43$fn__47.invoke(compile.clj:16)

at clojuresque.tasks.compile$eval41$main_task_driver__43.invoke(compile.clj:13)

at clojuresque.tasks.compile$eval41$main__56.invoke(compile.clj:5)

at clojure.lang.AFn.applyToHelper(AFn.java:152)

at clojure.lang.AFn.applyTo(AFn.java:144)

at clojure.core$apply.invokeStatic(core.clj:646)

at clojure.core$apply.invoke(core.clj:641)

at clojure.lang.Var.invoke(Var.java:383)

at clojuresque.Driver.main(Driver.java:49)

Caused by: java.lang.RuntimeException: Accessed Blocks before Bootstrap!

at net.minecraft.init.Blocks.<clinit>(Blocks.java:252)

... 34 more

 

 

 

I did a little bit of testing, and figured out that this seems to be caused when the compiled Clojure file registry__init.class is present. Upon deleting this specific file, it compiled just fine. After this file was generated and I try to compile again, it crashes again. For those who can actually read byte code, the file in question is downloadable here (I have a feeling this goes down to the bytecode level).

 

This seems to be caused due to me importing the BiomeGenBase class, which contains references to the Blocks class. Upon removing the import, this goes away completely, though I shouldn't have to do this. The Blocks class seems to now include a check to see if Bootstrap registry is complete, that wasn't present in 1.7.10, which will through an error if the Bootstrap class returns false for whether or not it is finished. But for some weird reason, whenever the generated class file is not present it works fine, but whenever the class file is present, this causes it to return false on the check, crashing the program. I have absolutely no idea what is causing that.

 

So there you go. If no one can solve this problem, I'll try to post it on a Clojure board, since it could be a problem with Clojure's compiler as well.

Currently working on a mod to provide support for the Clojure programming language in Minecraft, check it out here.

Link to comment
Share on other sites

Ok, so ... Bootstrap is like the first thing that happens when Minecraft (not forge, forge loads before MC) starts up. So, you are doing something that is causing your code to load before Minecraft. This means you have a coremod (@Mod mods are loaded later than MC). So: Why do you have a coremod? :D

 

I don't. Actually, I probably should mention that this error is THROWN AT COMPILE TIME (aka when compiling not running). I think it might have to do with how Clojure tends to preload things at compile time. Maybe.

Currently working on a mod to provide support for the Clojure programming language in Minecraft, check it out here.

Link to comment
Share on other sites

My suggestion: Stop using Clojure.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Yeah, that... that would explain things. Why does it do that? :o

 

Good question! I have no idea! Again, probably something with the Clojure compiler, might try asking people experienced with Clojure about it. It probably has something to do with how I need to AOT compile things. I've experienced a similar problem in the past, where importing client-side files in a namespace and then would crash on the server side even though the namespace was never used when it was on the server side.

 

My suggestion: Stop using Clojure.

 

Nah, I don't think so.

 

That might sound a bit stubborn to you, but my project is called forge-clj for a reason, with that reason to provide support for Clojure in Minecraft. In other words, Clojure is kinda the entire point of this.

Currently working on a mod to provide support for the Clojure programming language in Minecraft, check it out here.

Link to comment
Share on other sites

Fixed it! Now let me explain what it was.

 

Apparently, Clojure isn't SUPPOSED to load imported classes, and this was fixed in Clojure version 1.7. However, the gradle plugin I was using to compile the Clojure code was using Clojure version 1.6. Luckily for me, there was a not-very-well-documented newer release for that plugin, and upon updating the issue went away. So yeah, that's what it was.

Currently working on a mod to provide support for the Clojure programming language in Minecraft, check it out here.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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