Package net.minecraftforge.client.model
Class ItemLayerModel
java.lang.Object
net.minecraftforge.client.model.ItemLayerModel
- All Implemented Interfaces:
IModelGeometry<ItemLayerModel>
Forge reimplementation of vanilla
ItemModelGenerator
, i.e. builtin/generated models,
with the following changes:
- Represented as a true UnbakedModel
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
Modifier and TypeClassDescriptionprivate static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate com.google.common.collect.ImmutableSet<Integer>
private static Direction[]
static ItemLayerModel
private com.google.common.collect.ImmutableList<Material>
private static Direction[]
-
Constructor Summary
ConstructorDescriptionItemLayerModel(com.google.common.collect.ImmutableList<Material> textures)
ItemLayerModel(com.google.common.collect.ImmutableList<Material> textures, com.google.common.collect.ImmutableSet<Integer> fullbrightLayers)
-
Method Summary
Modifier and TypeMethodDescriptionbake(IModelConfiguration owner, ModelBakery bakery, Function<Material,TextureAtlasSprite> spriteGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation)
private static BakedQuad
buildQuad(Transformation 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(Transformation 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, Transformation transform)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprite(int tint, TextureAtlasSprite sprite, Transformation transform, boolean fullbright)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprites(List<Material> textures, Transformation transform, Function<Material,TextureAtlasSprite> spriteGetter)
static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprites(List<Material> textures, Transformation transform, Function<Material,TextureAtlasSprite> spriteGetter, Set<Integer> fullbrights)
private static com.google.common.collect.ImmutableList<Material>
getTextures(IModelConfiguration model)
getTextures(IModelConfiguration owner, Function<ResourceLocation,UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,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
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 Details
-
INSTANCE
-
HORIZONTALS
-
VERTICALS
-
textures
-
fullbrightLayers
-
-
Constructor Details
-
ItemLayerModel
public ItemLayerModel() -
ItemLayerModel
-
ItemLayerModel
-
-
Method Details
-
getTextures
private static com.google.common.collect.ImmutableList<Material> getTextures(IModelConfiguration model) -
bake
public BakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material,TextureAtlasSprite> spriteGetter, ModelState modelTransform, ItemOverrides overrides, ResourceLocation modelLocation)- Specified by:
bake
in interfaceIModelGeometry<ItemLayerModel>
-
getLayerRenderType
-
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(List<Material> textures, Transformation transform, Function<Material,TextureAtlasSprite> spriteGetter) -
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(List<Material> textures, Transformation transform, Function<Material,TextureAtlasSprite> spriteGetter, Set<Integer> fullbrights) -
getQuadsForSprite
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, Transformation transform) -
getQuadsForSprite
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, Transformation transform, boolean fullbright) -
getTextures
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation,UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> missingTextureErrors)- Specified by:
getTextures
in interfaceIModelGeometry<ItemLayerModel>
-
buildSideQuad
private static BakedQuad buildSideQuad(Transformation transform, Direction side, int tint, TextureAtlasSprite sprite, int u, int v, int size, boolean fullbright) -
remap
-
buildQuad
private static BakedQuad buildQuad(Transformation 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)
-