VoltzEngine-Project / Engine

Minecraft modding core lib
Other
13 stars 11 forks source link

Infinite recursion in JsonContentLoader.loadResourcesFromFolder() if ./config/bbm/json/ contains a directory #103

Closed DracoScythem closed 6 years ago

DracoScythem commented 6 years ago

Minecraft Version: 1.7.10 Forge Version: 1614 VoltzEngine Version: 1.10.4b431 [latest curseforge build] (also occurs with 'beta'-tagged releases)

crash-report: https://pastebin.com/UjwY8y4d

Creating a directory in ./config/bbm/json/ will cause the game to crash with a StackOverflowException during PreInit-Init transition. This is caused by a faulty recursive call at https://github.com/VoltzEngine-Project/Engine/blob/development/src/main/scala/com/builtbroken/mc/framework/json/JsonContentLoader.java#L785 where the originally searched folder is being passed down instead of the newly found subdirectory.

This is alleviated/worsened (depending on perspective) by the fact that the (external) Json system of VoltzEngine is entirely undocumented. (I found this issue by recreating the content filestructure used by VE internally in an attempt to modify VEs ores)

DarkGuardsman commented 6 years ago

How in the world did that go unnoticed for this long. I'll fix it in a few seconds.

DarkGuardsman commented 6 years ago

The issue is fixed and I added automated testing to check for it. This way if the problem pops up again the build will fail long before it gets pushed to live downloads. As well the test should also catch issues reading and finding subfolders. Along with checking the type of said files.

As for the documentation, I am planning on implementing it this summer. Which I should have completely free as I have no job and will complete my BS in computer science. So nothing should slow down the progress on getting the documentation up and finished.

When implemented there will be an in-game version and wiki version of the documentation. I'm also hoping to complete an editor at some point. This way working with the JSON files should be much faster.

DracoScythem commented 6 years ago

Okay, thank you :)