Modded crafting materials have no icon

I’m pretty sure this is a bug, and it’s not just my stupidness, but I could be wrong.

Summary: When a mod adds an item, it shows up properly if it’s the item being crafted, but if it is an ingredient it does not.

Steps to Reproduce:

  1. Install a mod which uses an item from a mod.
  2. Play game
  3. Open up a crafting workshop menu and look at a recipe which requires an item from a mod to produce.

Expected Results:
Modded in items have an icon when used as an ingredient.

Actual Results:
Modded in items do not have an icon when used as an ingredient.

Notes:
It’s not just my mod(colors/wildflowers), but it is also happening to @OneLaughingLlama’s Garden/Forest mod. At least on my computer it is.
The recipes are craftable, but there is no icon.
It does not happen to stonehearth.smod icons.

Attachments:

Original Code:

{
   "mixins": "stonehearth:mixins:item_properties",
   "type": "entity",
   "components": {
      "item": {
         "stacks": 10
      },
      "model_variants": {
         "default": {
            "models": [
               "file(cloth_bolt.qb)"
            ]
         }
      },
      "unit_info": {
         "name": "Bolt of Cloth",
         "description": "Soft and comforting.",
         "icon" : "file(cloth_bolt.png)"
      },
      "stonehearth:material" : {
         "tags" :  "cloth resource cloth_asset"
      },
      "mob" : {
         "model_origin" : { "x": -0.05, "y": 0, "z": 0.05 }
      }
   }
}

My Code:

{
   "mixins": "stonehearth:mixins:item_properties",
   "type": "entity",
   "components": {
      "item": {
         "stacks": 10
      },
      "model_variants": {
         "default": {
            "models": [
               "file(cloth_bolt_red.qb)"
            ]
         }
      },
      "unit_info": {
         "name": "Red Bolt of Cloth",
         "description": "Soft and comforting.",
         "icon" : "cloth_bolt_red.png"
      },
      "stonehearth:material" : {
         "tags" :  "cloth resource cloth_asset red"
      },
      "mob" : {
         "model_origin" : { "x": -0.05, "y": 0, "z": 0.05 }
      }
   }
}

Identical, except for the added red.
I have tried other file path formats and none of them worked.
There were no errors in the .log file
Top Secret Upload of my Mod here

Version and Mods:
Stonehearth a6 0.1.0 r166
Colors Mod by Me (testing unreleased version)
Wildflowers Mod by Me
Garden Mod by OneLaughingLlama
Forest Mod by OneLaughingLlama

System Info:
OS: Windows 8.1 x64
CPU: Intel Core i7-4700HQ 2.40GHz
Memory: 12GB
GPU: GTX860M

1 Like

I’m pretty sure icons not showing is a matter of wrong paths, it must be taking it wrong from somewhere. I’ll give it a try and report back.

Edit: Ok. Looks like it has affected only the first one?
I only tested the garden mod. You’re right, when the item is being crafted, the icons of the ingredients appear.

But I only saw affected the first item in the list, the Apple Tree. I clicked on the others and the icons for the ingredients were visible. Then I told to craft the Apple Tree and another one, and when the crafter began to gather the ingredients, the icons for the Apple Tree appeared.

Looks quite, quite weird. :confused:

Ah, you are correct about it only affecting the first one in the garden mod, that is strange =/

In my mod they never show up, I’ll dig through the code again and see if I can find a way for them to show up at least part of the time. I’ve uploaded the alpha of the mod here, so people can take a look at the bug.

1 Like

I have figured out what is going on, I think.

If you use a uri to specify an item it will find the icon.
However, if you use a tag if will only find the icon if the material is located in stonehearth.smod.

So

"uri" : "colors-base:thread_blue",

and

"material" : "wood resource",

will display an icon, but

"material" : "blue thread resource",

will not, because the icon is not a vanilla item.

material is merely a collection of tags; it is used to decide what can go into what stockpile and what can be considered as resource for some recipes (think of OreDictionary stuff in Minecraft on a different level).

uri and material should not be exclusive, but I’m not sure what uri would look like. I haven’t looked into that section of the code yet.

Out of interest: You can craft it?

Yes they are all craftable, so stonehearth is able to find the objects, just not always display an icon for them; If they are being referenced by tags in a recipe and if it’s a non vanilla item

Also material is only used in recipes, not for what can go into stockpiles. That is placeable_category and tags, though tags is seeming to be becoming depreciated?

Any other information about this bug. It’s obviously happening in Nihonjin as well?

No new information that I am aware of. I had to use uri for all of my recipes to get icons, except for dyes which need to have the material tag system in order to maintain cross mod compatibility.

Did you mixinto your new materials into stonehearth/ui/data/constants.json? The image for the workshop is taken from that source. Without a proper entry, your image and title will be off, but crafting likely works like it should.

2 Likes

That looks like it will work! =D
I’ll have to try it when I have the time.