Open deathcap opened 8 years ago
This would very useful for items in voxel-clientmc (https://github.com/voxel/voxel-clientmc/pull/26), where the item name -> item texture mapping is non-obvious (wheat_seeds is items/seeds_wheat). Relevant: minecraft-data images https://github.com/PrismarineJS/minecraft-data/issues/78
Currently, the API provided by this module returns a texture given its name (
artpacks.getTexture('crafting_table_top')
, etc.). Plugins which add blocks have their own list of textures for each of the cube sides, for example voxel-workbench:This knowledge could be better abstracted away and factored out into
artpacks
, so it can be changed by the user in customized art packs (also dovetails nicely with non-cubic block texture support).The resource pack format used by Minecraft has JSON definitions,
models/block/crafting_table.json
defines (https://github.com/vogonistic/mineflayer-voxel/pull/1#issuecomment-170300198):In addition to recognizing the .png and .mcmeta files, artpacks could also read the .json block models (see also: arbitrary model definitions to WebGL: https://github.com/deathcap/block-models; down/up/north/east/south/west to cube-side-array faces) and supply a
getBlockTextures()
(or whatever) API. The implementation in voxel-workbench would only have to say the block model is "crafting_table", and then it would be textured dynamically appropriately. Consider how to fit into https://github.com/voxel/voxel-stitch, which reads texture names from voxel-registry and texture data from artpacks.