-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update TypeRegistry #23
Comments
…ry as is. A type can also be loaded by supplying just the name. Based on the name of the type, a material is loaded from the theme's folder. When no material could be found, the default block material is used. #23
…that can be combined. When the three type textures are found (top, side, bottom) they are combined in a single texture. #23
With the recent changes to the TypeRegistry, there are now 3 possible ways to register a type to the Using a materialYou can directly set a material for a specific type: Material customGrassMaterial = assetManager.loadMaterial("/path/to/my/material/myGrass.j3m");
TypeRegistry typeRegistry = BlocksConfig.getInstance().getTypeRegistry();
typeRegistry.register(TypeIds.GRASS, customGrassMaterial); Using a material in the theme folderYou can place a material file in the theme folder. The Using textures in the theme folderWhen a material file couldn't be found for the type, the If the block should use different images in the texture, the images should be combined in the same texture file using an image editor. See the wiki page about theming for more information. Using multiple textures in the theme folderA 'quality of life' update is made so you don't need to use an image editor to combine the top image, side image and bottom image into one texture. Make sure to name the images correct, otherwise they will not be found by the |
The
TypeRegistry
will be adapted to make it more easy to use custom created materials. It will however still be simple to change or update a texture of a block.The current solution always uses the same material (
Blocks/Materials/default-block.j3m
) based on theLighting.j3md
material definition. Textures are loaded from the theme folder and set on the material. This way it's easy to change textures, but it's not possible to use other materials that are not based on theLighting.j3md
material definition. This way PBR is not supported for example.When a material file is found in the theme's folder, it should be used for that type. When there is no material file found, the old behavior should remain. In this case, the default material (
Blocks/Materials/default-block.j3m
) will be used and the textures in the theme's folder will be loaded.Another 'quality of life' update is to let the
TypeRegistry
automatically pack textures together. Now you still need to use an image editor to combine the top, side and bottom textures into one texture. When you supply the 3 textures (top, side, bottom) in the theme's folder instead of the already combined one, theTypeRegistry
will combine them and set them on the default material.The text was updated successfully, but these errors were encountered: