Jump to content

[1.19.x] DataGen and other mods


TaeoG

Recommended Posts

If you mean the real recipe objects, then no.

Recipes are loaded when the datapacks are loaded. i.e. when the game loads a save

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

2 hours ago, TaeoG said:

Is it possible during the GatherDataEvent event to do things like iterate through the recipes of another mod that you have as a dependency?

Depends on the context. If you just need to see whether the recipe exists, then yes; you can use `ExistingFileHelper#exists` to check. However, if you need to check the contents of the recipe, you would need to load them yourself because I don't believe that packs are loaded during data generation. However, you should generally only need the first case. Additionally, you would have to declare `--existing-mod', '<modid>' as one of the arguments in your data configuration.

Link to comment
Share on other sites

Ah that's a bummer, but not terribly surprising. My hope was to find all items that meet certain criteria, like having something in their recipe, and put those items in a tag. I can do it by hand of course but it gets unwieldy.

Link to comment
Share on other sites

2 hours ago, TaeoG said:

My hope was to find all items that meet certain criteria, like having something in their recipe, and put those items in a tag.

It would probably be better to do that in code when recipes are loaded normally. I would use `TagsUpdatedEvent` as it is guaranteed to be executed after recipes are loaded on the server. I'm suggesting this event as `RecipesUpdatedEvent` is only on the client.

Link to comment
Share on other sites

13 hours ago, TaeoG said:

If there is a datapack altering these tags, would it be loaded before or after this event?

All datagen entries are loaded before this event iirc. Though, I just remembered there was the `OnDatapackSyncEvent` which happens literally after everything is loaded on the server except for functions and structures, which you don't care about.

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.

Announcements



×
×
  • Create New...

Important Information

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