Jump to content

[1.19.2] Sharing textures between mods


DirtEngineer

Recommended Posts

I am working on extending a mod that creates custom chemical compounds so that other mods could make their own custom compounds under their own namespace.  Drop a JSON in your data folder, call a few methods, fire and forget.

I want the calling mod's products to use the same textures as the core mod for ease of use and consistency.  I can't seem to successfully access the textures in the core mod from the calling mod.
I can force the model generation.  When I do, everything runs fine.  It's just that the items are completely invisible.  No magenta/black block, simply invisible.  That tells me that the model is there and being accessed, just no access to the textures that it references.
I want to avoid requiring that the consumer load a set of textures manually.
Here is an example of an item model that is generated.

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "basemod:items/the_item_layer_0",
    "layer1": "basemod:items/the_item_layer_1"
  }
}

 

Link to comment
Share on other sites

If this is 1.19.3, textures need to be in the item folder not items. See Mojang's change notes

Otherwise you are going to need to show more than just 4 lines of json, preferably on github.

Does changing it to use minecraft:item/apple work?

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

It's 1.19.2.  The textures are in the correct directory location in the called mod.
Yes.  Substituting "minecraft:item/apple" works for the calling mod.

Look at generateCompoundModels() on line 33 in ModItemModelGenerator.java.
The current location for the .texture is cleaned up.  I tried various configurations for the location.
One aspect that might that may be pertinent is that this is called by the calling mod from its datagen events as registered in addListeners() on line 104 in AddonRegisters.java.

Link to comment
Share on other sites

It's not something I know a lot about, but I bet this has something to do with how you configure the existing files helper?

https://forge.gemwire.uk/wiki/Datageneration/States_and_Models

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

I have no idea what you need to do. I have never played with it. I only answered this question because of the 1.19.3 change.

The wiki says:

Quote

By default, only the vanilla datapack and resources are available to the ExistingFileHelper.

Of course, I might be completely misleading you into the wrong direction. As I said, I know little about this feature.

Edited by warjort

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

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.