tomalbrc / filament

server side blocks & items
GNU Lesser General Public License v3.0
7 stars 2 forks source link

Item texture and item name does not appear correctly. #8

Open spinodal23 opened 1 day ago

spinodal23 commented 1 day ago

Issue

I cannot find any specific examples of adding ingots using filaments, so I tried to make a test datapack as follows. Item texture and item name does not appear correctly. (There is a screenshot below.)

6_VH/
|-- assets/
|   \-- chromatics/
|       |-- lang/
|       |   \-- en_us.json
|       |-- models/
|       |   \-- custom/
|       |       \-- item/
|       |           \-- black_chromatic_steel_ingot.json
|       \-- textures/
|           \-- item/
|               |-- black_chromatic_steel_ingot.png
|               \-- black_chromatic_steel_ingot.png.mcmeta
|-- data/
|   \-- chromatics/
|       \-- filament/
|           \-- item/
|               \-- black_chromatic_steel_ingot.json
\-- pack.mcmeta

Details of the files: 6_VH/assets/chromatics/lang/en_us.json

{
  "item.chromatics.black_chromatic_steel_ingot": "Black Chromatic Steel Ingot"
}

6_VH/assets/chromatics/models/custom/item/black_chromatic_steel_ingot.json

{
  "textures": {
    "layer0": "chromatics:item/black_chromatic_steel_ingot"
  }
}

6_VH/assets/chromatics/textures/item/black_chromatic_steel_ingot.png black_chromatic_steel_ingot

6_VH/assets/chromatics/textures/item/black_chromatic_steel_ingot.png.mcmeta

{
  "animation": {
    "frametime": 20,
    "interpolate": true,
    "frames": [
      0,1,2,3,4,5,6,7,6,5,4,3,2,1
    ]
  }
}

6_VH/data/chromatics/filament/item/black_chromatic_steel_ingot.json

{
  "id": "chromatics:black_chromatic_steel_ingot",
  "vanillaItem": "minecraft:iron_ingot",
  "itemResource": {
    "models": {
      "default": "chromatics:custom/item/black_chromatic_steel_ingot"
    }
  },
  "properties": {
    "stackSize": 64
  }
}

pack.mcmeta

{
   "pack":{
      "pack_format": 48,
      "description": "test datapack - add an ingot from the Vault Hunter modpack"
   }
}

I'm sure I've done something wrong somewhere, but because of lack of references I can't find where is wrong.

Screenshots

2024-10-23_00 27 49


Minecraft

1.21.1

Fabric API

0.102.1

Fabric Loader

0.16.5

filament

0.9.3

Polymer

0.9.17

spinodal23 commented 17 hours ago

I followed "allay_bottle.json" in the official example datapack, so my datapack is changed as follows. lang is moved to resourcepack, so the item name now appear correctly. However, the item texture is still the minecraft iron ingot, not custom texture.

Datapack:

6_VH/
|-- assets/
|   \-- minecraft/
|       |-- models/
|       |   \-- custom/
|       |       \-- item/
|       |           \-- black_chromatic_steel_ingot.json
|       \-- textures/
|           \-- item/
|               |-- black_chromatic_steel_ingot.png
|               \-- black_chromatic_steel_ingot.png.mcmeta
|-- data/
|   \-- chromatics/
|       \-- filament/
|           |-- item/
|           |   \-- black_chromatic_steel_ingot.json
|           \-- item-groups.json
\-- pack.mcmeta

6_VH/assets/minecraft/models/custom/item/black_chromatic_steel_ingot.json

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "item/black_chromatic_steel_ingot"
  }
}

6_VH/assets/minecraft/textures/item/black_chromatic_steel_ingot.png: same as the original 6_VH/assets/minecraft/textures/item/black_chromatic_steel_ingot.png.mcmeta: same as the original

6_VH/data/chromatics/filament/item/black_chromatic_steel_ingot.json

{
  "id": "chromatics:black_chromatic_steel_ingot",
  "group": "chromatics:chromatic_items",
  "vanillaItem": "minecraft:iron_ingot",
  "itemResource": {
    "models": {
      "default": "minecraft:custom/item/black_chromatic_steel_ingot"
    }
  }
}

6_VH/data/chromatics/filament/item-groups.json

[
  {
    "id": "chromatics:chromatic_items",
    "item": "chromatics:black_chromatic_steel_ingot"
  }
]

6_VH/pack.mcmeta: same as original.

Resourcepack:

7_VH/
|-- assets/
|   \-- chromatics/
|       \-- lang/
|           \-- en_us.json/
|-- pack.mcmeta
\-- pack.png

7_VH/assets/chromatics/lang/en_us.json

{
  "chromatics.itemGroup.chromatic_items": "Chromatic Items",
  "item.chromatics.black_chromatic_steel_ingot": "Black Chromatic Steel Ingot"
}

7_VH/pack.mcmeta

{
  "pack": {
    "pack_format": 34,
    "description": "test datapack - add an ingot from the Vault Hunter modpack"
  }
}

7_VH/pack.png pack

Screenshot:

2024-10-23_21 19 35


Because the texture is not applied by the above method, (1) I tried to move models and textures folders from the datapack to the resourcepack, but the result was the same. (2) I tried to copy models and textures folders from the datapack and pasted it to the same directory of the resourcepack, but the result was the same.

What method should I try to make the texture appear correctly?

tomalbrc commented 16 hours ago

You will have to run /polymer generate-pack and then F3+T

Will be fixed/automated for single player datapacks next update

spinodal23 commented 6 hours ago

Thank you, it works now :)