node-minecraft-assets icon indicating copy to clipboard operation
node-minecraft-assets copied to clipboard

Slash in filename?

Open njt1982 opened this issue 5 years ago • 3 comments

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 avatar Aug 22 '20 23:08 njt1982

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

njt1982 avatar Aug 22 '20 23:08 njt1982

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 avatar Aug 22 '20 23:08 njt1982

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

njt1982 avatar Aug 22 '20 23:08 njt1982