Class ModelHelper
java.lang.Object
net.fabricmc.fabric.api.client.renderer.v1.model.ModelHelper
Collection of utilities for model implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intResult fromtoFaceIndex(Direction)for null values. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeMaterialFlags(QuadView quad) Computes the vanilla material flags for the given quad.static com.mojang.blaze3d.platform.TransparencycomputeTransparency(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, QuadView quad) Computes theTransparencyfor aTextureAtlasSprite, using the vertex UVs from the given quad.static @Nullable net.minecraft.core.DirectionfaceFromIndex(int faceIndex) Use to decode a result fromtoFaceIndex(Direction).static inttoFaceIndex(@Nullable net.minecraft.core.Direction face) Convenient way to encode faces that may be null.
-
Field Details
-
NULL_FACE_ID
-
-
Method Details
-
toFaceIndex
public static int toFaceIndex(@Nullable net.minecraft.core.Direction face) Convenient way to encode faces that may be null. Null is returned asNULL_FACE_ID. UsefaceFromIndex(int)to retrieve encoded face. -
faceFromIndex
public static @Nullable net.minecraft.core.Direction faceFromIndex(int faceIndex) Use to decode a result fromtoFaceIndex(Direction). Return value will be null if encoded value was null. Can also be used for no-allocation iteration ofDirection.values(), optionally including the null face. (Use < or <=NULL_FACE_IDto exclude or include the null value, respectively.) -
computeTransparency
public static com.mojang.blaze3d.platform.Transparency computeTransparency(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, QuadView quad) Computes theTransparencyfor aTextureAtlasSprite, using the vertex UVs from the given quad. -
computeMaterialFlags
Computes the vanilla material flags for the given quad. This operation is cheap.
-