Package net.minecraftforge.client.model
Class ItemLayerModel
- java.lang.Object
-
- net.minecraftforge.client.model.ItemLayerModel
-
- All Implemented Interfaces:
IModelGeometry<ItemLayerModel>
public final class ItemLayerModel extends java.lang.Object implements IModelGeometry<ItemLayerModel>
Forge reimplementation of vanillaItemModelGenerator
, i.e. builtin/generated models, with the following changes: - Represented as a trueIUnbakedModel
so it can be baked as usual instead of using special-case logic like vanilla does. - Various fixes in the baking logic. - Not limited to 4 layers maximum.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ItemLayerModel.FaceData
static class
ItemLayerModel.Loader
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableSet<java.lang.Integer>
fullbrightLayers
private static Direction[]
HORIZONTALS
static ItemLayerModel
INSTANCE
private com.google.common.collect.ImmutableList<RenderMaterial>
textures
private static Direction[]
VERTICALS
-
Constructor Summary
Constructors Constructor Description ItemLayerModel()
ItemLayerModel(com.google.common.collect.ImmutableList<RenderMaterial> textures)
ItemLayerModel(com.google.common.collect.ImmutableList<RenderMaterial> textures, com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IBakedModel
bake(IModelConfiguration owner, ModelBakery bakery, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
private static BakedQuad
buildQuad(TransformationMatrix transform, Direction side, TextureAtlasSprite sprite, int tint, boolean fullbright, float x0, float y0, float z0, float u0, float v0, float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3)
private static BakedQuad
buildSideQuad(TransformationMatrix transform, Direction side, int tint, TextureAtlasSprite sprite, int u, int v, int size, boolean fullbright)
static RenderType
getLayerRenderType(boolean isFullbright)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform, boolean fullbright)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprites(java.util.List<RenderMaterial> textures, TransformationMatrix transform, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprites(java.util.List<RenderMaterial> textures, TransformationMatrix transform, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter, java.util.Set<java.lang.Integer> fullbrights)
private static com.google.common.collect.ImmutableList<RenderMaterial>
getTextures(IModelConfiguration model)
java.util.Collection<RenderMaterial>
getTextures(IModelConfiguration owner, java.util.function.Function<ResourceLocation,IUnbakedModel> modelGetter, java.util.Set<com.mojang.datafixers.util.Pair<java.lang.String,java.lang.String>> missingTextureErrors)
private static void
putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v, int uLight, int vLight)
private static Direction
remap(Direction side)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.client.model.geometry.IModelGeometry
getPart, getParts
-
-
-
-
Field Detail
-
INSTANCE
public static final ItemLayerModel INSTANCE
-
HORIZONTALS
private static final Direction[] HORIZONTALS
-
VERTICALS
private static final Direction[] VERTICALS
-
textures
private com.google.common.collect.ImmutableList<RenderMaterial> textures
-
fullbrightLayers
private final com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers
-
-
Constructor Detail
-
ItemLayerModel
public ItemLayerModel()
-
ItemLayerModel
public ItemLayerModel(com.google.common.collect.ImmutableList<RenderMaterial> textures)
-
ItemLayerModel
public ItemLayerModel(@Nullable com.google.common.collect.ImmutableList<RenderMaterial> textures, com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers)
-
-
Method Detail
-
getTextures
private static com.google.common.collect.ImmutableList<RenderMaterial> getTextures(IModelConfiguration model)
-
bake
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
- Specified by:
bake
in interfaceIModelGeometry<ItemLayerModel>
-
getLayerRenderType
public static RenderType getLayerRenderType(boolean isFullbright)
-
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(java.util.List<RenderMaterial> textures, TransformationMatrix transform, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter)
-
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(java.util.List<RenderMaterial> textures, TransformationMatrix transform, java.util.function.Function<RenderMaterial,TextureAtlasSprite> spriteGetter, java.util.Set<java.lang.Integer> fullbrights)
-
getQuadsForSprite
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform)
-
getQuadsForSprite
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform, boolean fullbright)
-
getTextures
public java.util.Collection<RenderMaterial> getTextures(IModelConfiguration owner, java.util.function.Function<ResourceLocation,IUnbakedModel> modelGetter, java.util.Set<com.mojang.datafixers.util.Pair<java.lang.String,java.lang.String>> missingTextureErrors)
- Specified by:
getTextures
in interfaceIModelGeometry<ItemLayerModel>
-
buildSideQuad
private static BakedQuad buildSideQuad(TransformationMatrix transform, Direction side, int tint, TextureAtlasSprite sprite, int u, int v, int size, boolean fullbright)
-
buildQuad
private static BakedQuad buildQuad(TransformationMatrix transform, Direction side, TextureAtlasSprite sprite, int tint, boolean fullbright, float x0, float y0, float z0, float u0, float v0, float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3)
-
putVertex
private static void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v, int uLight, int vLight)
-
-