Class UnbakedElementsHelper
java.lang.Object
net.neoforged.neoforge.client.model.UnbakedElementsHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbakeElements
(List<BlockElement> elements, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState) Bakes a list of block elements and returns the list of baked quads.static void
bakeElements
(IModelBuilder<?> builder, List<BlockElement> elements, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState) Bakes a list of block elements and feeds the baked quads to a model builder.static ModelState
composeRootTransformIntoModelState
(ModelState modelState, Transformation rootTransform) Returns aModelState
that combines the existing model state and the root transform.static List
<BlockElement> createUnbakedItemElements
(int layerIndex, TextureAtlasSprite sprite) static List
<BlockElement> createUnbakedItemElements
(int layerIndex, TextureAtlasSprite sprite, @Nullable ExtraFaceData faceData) Creates a list of block elements in the shape of the specified sprite contents.static List
<BlockElement> createUnbakedItemMaskElements
(int layerIndex, TextureAtlasSprite sprite) static List
<BlockElement> createUnbakedItemMaskElements
(int layerIndex, TextureAtlasSprite sprite, @Nullable ExtraFaceData faceData) Creates a list of block elements in the shape of the specified sprite contents.
-
Field Details
-
ITEM_MODEL_GENERATOR
-
-
Constructor Details
-
UnbakedElementsHelper
private UnbakedElementsHelper()
-
-
Method Details
-
createUnbakedItemElements
public static List<BlockElement> createUnbakedItemElements(int layerIndex, TextureAtlasSprite sprite) - See Also:
-
createUnbakedItemElements
public static List<BlockElement> createUnbakedItemElements(int layerIndex, TextureAtlasSprite sprite, @Nullable @Nullable ExtraFaceData faceData) Creates a list of block elements in the shape of the specified sprite contents. These can later be baked using the same, or another texture.The
Direction.NORTH
andDirection.SOUTH
faces take up the whole surface. -
createUnbakedItemMaskElements
public static List<BlockElement> createUnbakedItemMaskElements(int layerIndex, TextureAtlasSprite sprite) - See Also:
-
createUnbakedItemMaskElements
public static List<BlockElement> createUnbakedItemMaskElements(int layerIndex, TextureAtlasSprite sprite, @Nullable @Nullable ExtraFaceData faceData) Creates a list of block elements in the shape of the specified sprite contents. These can later be baked using the same, or another texture.The
Direction.NORTH
andDirection.SOUTH
faces take up only the pixels the texture uses. -
bakeElements
public static void bakeElements(IModelBuilder<?> builder, List<BlockElement> elements, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState) Bakes a list of block elements and feeds the baked quads to a model builder. -
bakeElements
public static List<BakedQuad> bakeElements(List<BlockElement> elements, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState) Bakes a list of block elements and returns the list of baked quads. -
composeRootTransformIntoModelState
public static ModelState composeRootTransformIntoModelState(ModelState modelState, Transformation rootTransform) Returns aModelState
that combines the existing model state and the root transform.- Returns:
- a
ModelState
that combines the existing model state and the root transform
-