|
16 | 16 |
|
17 | 17 | package net.fabricmc.fabric.api.client.model.fabric; |
18 | 18 |
|
| 19 | +import net.minecraft.block.Block; |
| 20 | +import net.minecraft.client.render.model.BakedModel; |
| 21 | +import net.minecraft.util.Identifier; |
| 22 | + |
19 | 23 | /** |
20 | 24 | * A reference to a model material that specifies texture blending, |
21 | 25 | * lighting, coloring and other aspects of quad rendering. Every |
|
38 | 42 | * Materials are not required to know their registration identity, and two materials |
39 | 43 | * with the same attributes may or may not satisfy equality and identity tests. Model |
40 | 44 | * implementations should never attempt to analyze materials or implement control logic based on them. |
41 | | - * They are only tokens for communicating quad attributes to the ModelRenderer. |
| 45 | + * They are only tokens for communicating quad attributes to the ModelRenderer.<p> |
| 46 | + * |
| 47 | + * <b>STANDARD MATERIALS</b><p> |
| 48 | + * |
| 49 | + * All {@link ModelRenderer} implementations must pre-register the water and lava materials |
| 50 | + * using the identifiers defined below. This gives models access to any fancy renders that may |
| 51 | + * be implemented for those materials.<p> |
42 | 52 | */ |
43 | 53 | public interface ModelMaterial { |
| 54 | + |
| 55 | + /** |
| 56 | + * This will be identical to the material that would be obtained by calling {@link ModelMaterialBuilder#build()} |
| 57 | + * on a new, unaltered, {@link ModelMaterialBuilder} instance. It is defined here for clarity and convenience. |
| 58 | + * |
| 59 | + * Quads using this material have a single texture layer, use {@link Block#getRenderLayer()} of the associated |
| 60 | + * block to determine texture blending (or translucent for item models), honor block color index, |
| 61 | + * are non-emissive, and have {@link ShadingMode} inferred from {@link BakedModel#useAmbientOcclusion()} |
| 62 | + * and block light level. All standard, non-fluid baked models are rendered using this material.<p> |
| 63 | + * |
| 64 | + * {@link ModelRenderer} implementations may or may not define and use more explicit materials for the |
| 65 | + * various context-dependent combinations of shading and render layer and those are not defined or exposed. |
| 66 | + */ |
| 67 | + Identifier MATERIAL_STANDARD = new Identifier("minecraft", "standard"); |
| 68 | + |
| 69 | + /** |
| 70 | + * Material that is used for water rendering. Useful if the model renderer implements |
| 71 | + * some kind of fancy render for water and you want a model to use the same effect. |
| 72 | + */ |
| 73 | + Identifier MATERIAL_WATER = new Identifier("minecraft", "water"); |
| 74 | + |
| 75 | + /** |
| 76 | + * Material that is used for lava rendering. Useful if the model renderer implements |
| 77 | + * some kind of fancy render for lava and you want a model to use the same effect. |
| 78 | + */ |
| 79 | + Identifier MATERIAL_LAVA = new Identifier("minecraft", "lava"); |
| 80 | + |
44 | 81 | /** |
45 | 82 | * The number of integers needed to represent a single quad with this materials. |
46 | 83 | * For use by models to allocate vertex storage and transfer vertex data. |
|
0 commit comments