Jump to content

[1.15.2] src/generated/resources is not being read by my code


squidlex

Recommended Posts

Hi there,

So I've been tinkering with Data Generators today and have managed to get my recipes to generate into src/generated/resources like I wanted, but the issue is the recipes don't work unless I move them into src/main/resources.

 

How do I make it so that my generated folder is recognised by forge?

 

Thanks for your help!

Link to comment
Share on other sites

I think you can change that in your build.gradle (haven't tried it yet myself) to make it generate them right in the src/main/resources

Quote

            args '--mod', 'dimtest', '--all', '--output', file('src/generated/resources/')

I would guess changing that src/generated/resources to src/main/resources would do it. However, I don't know if it clears out anything before it writes them, so make sure you have a backup or something just in case lol

  • Like 1
Link to comment
Share on other sites

20 minutes ago, squidlex said:

Hi there,

So I've been tinkering with Data Generators today and have managed to get my recipes to generate into src/generated/resources like I wanted, but the issue is the recipes don't work unless I move them into src/main/resources.

 

How do I make it so that my generated folder is recognised by forge?

 

Thanks for your help!

I got it to work!

I needed to add this:

sourceSets {
  main {
    resources {
      srcDirs += "src/generated/resources"
    }
  }
}

to my build.gradle.

 

Honestly don't know how I missed that.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Ugdhar said:

I think you can change that in your build.gradle (haven't tried it yet myself) to make it generate them right in the src/main/resources

I would guess changing that src/generated/resources to src/main/resources would do it. However, I don't know if it clears out anything before it writes them, so make sure you have a backup or something just in case lol

I tried that earlier and deleted everything by accident, I now make constant backups haha.

Thanks for the suggestion though, it works if you use '--existing' but I wanted my things to be seperate :)

 

Ugdhar's method may be cleaner for some users so it's worth noting if you're reading this in the future!

Edited by squidlex
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.