Class ModelHelper

java.lang.Object
net.fabricmc.fabric.api.client.renderer.v1.model.ModelHelper

public final class ModelHelper extends Object
Collection of utilities for model implementations.
  • Field Details

  • 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 as NULL_FACE_ID. Use faceFromIndex(int) to retrieve encoded face.
    • faceFromIndex

      public static @Nullable net.minecraft.core.Direction faceFromIndex(int faceIndex)
      Use to decode a result from toFaceIndex(Direction). Return value will be null if encoded value was null. Can also be used for no-allocation iteration of Direction.values(), optionally including the null face. (Use < or <= NULL_FACE_ID to 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 the Transparency for a TextureAtlasSprite, using the vertex UVs from the given quad.
    • computeMaterialFlags

      public static int computeMaterialFlags(QuadView quad)
      Computes the vanilla material flags for the given quad. This operation is cheap.