Minecraftforge: [1.14.4] Mod resources not loaded during data generation

Created on 16 Nov 2019  路  7Comments  路  Source: MinecraftForge/MinecraftForge


Minecraft Version: 1.14.4

Forge Version: 28.1.90

Logs: https://gist.github.com/Choonster/2ee4d06856ca409f85b89728e9ddd47e

Steps to Reproduce:

  1. Create a class that extends BlockStateProvider and register it during GatherDataEvent
  2. In the registerStatesAndModels method, call BlockStateProvider#simpleBlock(Block) with a block belonging to the mod being developed.

    1. The call to ModelBuilder#texture (in the methods called by BlockStateProvider#simpleBlock(Block)) throws an exception like the following: IllegalArgumentException: Texture <texture> does not exist in any known resource pack

See my test mod for a full demonstration of this.

Description of issue:
Mod resources aren't being loaded during data generation, so ModelBuilder#texture throws an exception saying that the texture doesn't exist for texture files that actually do exist.

Stale Triage

Most helpful comment

You need to add this to your build.gradle. Then it should find the existing resource pack:
https://github.com/MC-U-Team/Useful-Backpacks/blob/32922cd74ddb41f04897613dee301dd392fc3b88/build.gradle#L67

All 7 comments

You need to add this to your build.gradle. Then it should find the existing resource pack:
https://github.com/MC-U-Team/Useful-Backpacks/blob/32922cd74ddb41f04897613dee301dd392fc3b88/build.gradle#L67

@HyCraftHD Thanks, that fixes it.

The MDK's build.gradle should probably be updated to include that argument or it should have a default value set in the data generator code itself.

@DaemonUmbra That's where the argument would go, but it doesn't specify the --existing argument at the moment.

Oh, I missed that bit

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

Was this page helpful?
0 / 5 - 0 ratings