Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash in filename? #6

Open
njt1982 opened this issue Aug 22, 2020 · 3 comments
Open

Slash in filename? #6

njt1982 opened this issue Aug 22, 2020 · 3 comments

Comments

@njt1982
Copy link

njt1982 commented Aug 22, 2020

return 'data:image/png;base64,' + fs.readFileSync(path.join(__dirname, '/../minecraft-assets/data/', mcVersion, '/', texture, '.png'), 'base64')

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
Copy link
Author

njt1982 commented Aug 22, 2020

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

@njt1982
Copy link
Author

njt1982 commented Aug 22, 2020

@njt1982
Copy link
Author

njt1982 commented Aug 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant