Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes with Json Things #223

Open
WizardJoker opened this issue Nov 1, 2024 · 5 comments
Open

Crashes with Json Things #223

WizardJoker opened this issue Nov 1, 2024 · 5 comments
Assignees
Labels
bug Something isn't working to be reviewed requires additional analysis

Comments

@WizardJoker
Copy link

Issue description

Game failed to launch with Emendatus Enigmatica and Json Things.

Steps to reproduce

  1. Adding Emendatus Enigmatica and Json Things to a new instance
  2. Launch the instance
  3. Game failed to launch

Minecraft version

1.19.2 (Latest)

Forge version

43.4.4

Emendatus Enigmatica version

2.1.x (Latest)

Other relevant versions

Json Things: 0.7.15

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

https://mclo.gs/x8NCKcH

@WizardJoker
Copy link
Author

Reported to Json Things: gigaherz/JsonThings#39

@Kanzaji
Copy link
Contributor

Kanzaji commented Nov 8, 2024

Appears to be a timing issue in JsonThings from my little debugging session 😅 They request a pack reload which triggers EE Data generation, and then they try to reference the instance of the future with their manager, which fails because it is still being constructed. Magic of working in parallel essentially ^^"

Not much I can do to fix this on EE side, especially for 1.19.2 >.>

@gigaherz
Copy link

Fwiw, I don't request a pack reload per se.
Json Things loads a special kind of resource manager for "things", separate from "data" and "assets, so for that purpose it has a custom Pack Type. Understandably, a lot of mods don't know that there's going to be more enum entries than assets + data, so the code doesn't protect against this situation, and mods end up thinking it's resource packs, or data packs that are loading, and run the "wrong" code.
Thing is, because Json Things resources have to load before registry events, there's no way for me to change the timing of the code. I can only beg mod devs to add a default case in their pack type switch, or have if+else-if instead of just if+else.
That is assuming it's even this issue, which I didn't check to confirm.

@Kanzaji
Copy link
Contributor

Kanzaji commented Nov 13, 2024

Fwiw, I don't request a pack reload per se. Json Things loads a special kind of resource manager for "things", separate from "data" and "assets, so for that purpose it has a custom Pack Type. Understandably, a lot of mods don't know that there's going to be more enum entries than assets + data, so the code doesn't protect against this situation, and mods end up thinking it's resource packs, or data packs that are loading, and run the "wrong" code. Thing is, because Json Things resources have to load before registry events, there's no way for me to change the timing of the code. I can only beg mod devs to add a default case in their pack type switch, or have if+else-if instead of just if+else. That is assuming it's even this issue, which I didn't check to confirm.

That was just a summary of my understanding of the code, which as you can see I didn't get correct 😅
The issue here is that the EE Resource Manager is also being constructed by the construction of Json Things Resource Manager, and it takes too long for the future to get construct in time, resulting in NPE (from my understanding).

I would need to take more time to understand the underlying code and how everything is implemented, but like I said above, from the first quick debug session, it appears to be (in my understanding) a timing issue caused by EE data gen being executed when Json Things constructs the Resource Manager.

@Kanzaji
Copy link
Contributor

Kanzaji commented Nov 13, 2024

I think I have a possibly work-around for this issue on EE end however, but not sure if I will be able to release a patch for 1.19.2 as 1.21.1 is in the focus. I will test out if the issue persists on the 1.21.1 version as well hovewer, as the Data Generation logic was reworked on there 😅

Kanzaji added a commit to Kanzaji/EmendatusEnigmatica that referenced this issue Jan 8, 2025
Fixes Ridanisaurus#223 for 1.21.1
Adds custom Progress Bar for the Data Generation, making it not hang the main window for soo long anymore.
Fixes errors caused by missing default directory when trying to look for Namespaces by the ResourceManager.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to be reviewed requires additional analysis
Projects
None yet
Development

No branches or pull requests

4 participants