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

Declaring KubeJS recipes through event.custom results in crashes #2281

Open
2 tasks done
Xefyr0 opened this issue Nov 5, 2024 · 2 comments
Open
2 tasks done

Declaring KubeJS recipes through event.custom results in crashes #2281

Xefyr0 opened this issue Nov 5, 2024 · 2 comments
Labels
type: bug Something isn't working

Comments

@Xefyr0
Copy link

Xefyr0 commented Nov 5, 2024

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

1.4.6

Minecraft Version

1.20.1

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

Yes

Other Installed Mods

KubeJS, EMI, and all relevant dependencies

Expected Behavior

Declaring a recipe using KubeJS in event.custom according to the JSON format Gregtech: Modern uses would result in the recipe being created, or nothing would occur if it wasn't an intended feature.

Actual Behavior

Declaring a GT recipe in event.custom causes a crash if the recipe is in server_scripts when loading in to a world.
If the player starts in-game and then uses /reload to trigger the script after the fact, errors appear in the logs that contradict the in-game text notifications:
no_errors_my_ass

Steps to Reproduce

  1. Make a new instance.
  2. Copy the zipped example.js into KubeJS' server_scripts folder.
  3. Launch the game.
  4. Try to load into a world, triggering the script.
  5. Crash.
    example.zip

Additional Information

logs.zip is an archive of the game's logs when the script is in the game from the start.
logs-reload.zip is an archive of the game's logs when the player loads in to the world before adding the script, then uses /reload.
logs.zip
logs-reload.zip

@Xefyr0 Xefyr0 added the type: bug Something isn't working label Nov 5, 2024
@AncientShotgun
Copy link

Is there an adequate amount of user QoL incentive available for the devs to consider fixing this error? The docs say to use an event.recipes.gtceu.<machine_name>() call, which returns a RecipeBuilder for the scripter to fill in. GTCEuM even uses RecipeBuilders in it's own code, and I can't see any pre-pickled .json recipe files in the codebase...They're all directly registered at runtime from RecipeBuilders, as far as I can tell, and never even approach a JSON serializer or deserializer.
Where did you get that JSON recipe structure, anyway? Is there a file like it in the compiled .jar that I can reference?

@Deepacat
Copy link
Contributor

Deepacat commented Nov 6, 2024

yeap I had to just convert json to item stacks to achieve this, see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants