PrismarineJS / node-minecraft-assets

Provide minecraft assets in node.js
17 stars 13 forks source link

Slash in filename? #6

Open njt1982 opened 4 years ago

njt1982 commented 4 years ago

https://github.com/PrismarineJS/node-minecraft-assets/blob/6af1e492393890dca6ddc7885930d9c83f55bba6/lib/loader.js#L36

I'm getting this error: Error: ENOENT: no such file or directory, open '/Users/nthompson/Sites/minecraft-browser/node_modules/minecraft-assets/minecraft-assets/data/1.16.1/block/acacia_planks/.png'

Should it be texture + '.png' ?

njt1982 commented 4 years ago

Hmm that and it should be looking in blocks, not block...

njt1982 commented 4 years ago

That pluralisation issue seems to be an issue upstream?

https://github.com/PrismarineJS/minecraft-assets/blob/2b4b4effcf7b865321511fed8ae8c10f0df4fb36/data/1.16.1/items_textures.json#L100

  {
    "name": "acacia_planks",
    "model": "acacia_planks",
    "texture": "block/acacia_planks"
  },

That file is in blocks

https://github.com/PrismarineJS/minecraft-assets/blob/2b4b4effcf7b865321511fed8ae8c10f0df4fb36/data/1.16.1/blocks/acacia_planks.png

Interestingly, the blocks_textures file defines it correctly?

https://github.com/PrismarineJS/minecraft-assets/blob/2b4b4effcf7b865321511fed8ae8c10f0df4fb36/data/1.16.1/blocks_textures.json

njt1982 commented 4 years ago

So my "fix" has been to use mcAssets.textureContent[k].textureinstead of mcAssets.getImageContent(k) (where k is something like acacia_planks)