Textures being stretched

Hello, I had trouble creating a new block and putting a texture in the blocks library. The problem is that when I create a new block and I create a new material to put in, the texture gets stretched and deformed. (The texture is 64x64)
SharedScreenshot
it looks like that when it should be like that:
test_texture

By the way, here is the code
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); mat.setTexture("DiffuseMap", assetManager.loadTexture("Textures/test_texture.png")); Terranum.typeRegistry.register("TEST_BLOCK_TYPE",mat); Block block = Block.builder() .name("TEST_BLOCK") .shape(ShapeIds.CUBE) .type("TEST_BLOCK_TYPE") .usingMultipleImages(true) .transparent(false) .solid(true) .build(); BlocksConfig.getInstance().getBlockRegistry().register("TEST_BLOCK",block);

if you need something more just tell me.
Thanks

Looks like an issue with the block’s texture coordinates. Are you using @remy_vd 's Blocks library ?

Try setting useMultipleImages to false.

I was not pleased how the type registry is implemented in the current version of Blocks. It is totally revamped and the API is more transparent to use in the new version. It uses a texture atlas and there you can specify up to 6 images for a block, one for each face.

2 Likes

Changed useMultipleImages to false and it worked perfectly.

You previously said that the API had been revamped, but I haven’t been able to find documentation about it, so could you explain to me how it works now?

1 Like

It’s not released yet. Tests, documentation, … still needs to be finalised before release.
But I guess you can build the sources from scratch. However, I don’t know if I set the repository to public or private… Will need to check.

1 Like