game.materials.find('name') will return the actual index of the found material within game.materials but not the block type index.
So I added a new method to voxel-texture to fix this called game.materials.findIndex('name') and updated the test to simulate how textures are loaded into the materials API more closely.
Now doing game.setBlock([0, 0, 0], 'coal') will work correctly. My mistake!
game.materials.find('name')
will return the actual index of the found material withingame.materials
but not the block type index.So I added a new method to voxel-texture to fix this called
game.materials.findIndex('name')
and updated the test to simulate how textures are loaded into the materials API more closely.Now doing
game.setBlock([0, 0, 0], 'coal')
will work correctly. My mistake!