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 IUnbakedModel
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 final com.google.common.collect.ImmutableSet<Integer>
private static final Direction[]
static final ItemLayerModel
private com.google.common.collect.ImmutableList<RenderMaterial>
private static final Direction[]
-
Constructor Summary
ConstructorDescriptionItemLayerModel
(com.google.common.collect.ImmutableList<RenderMaterial> textures) ItemLayerModel
(com.google.common.collect.ImmutableList<RenderMaterial> textures, com.google.common.collect.ImmutableSet<Integer> fullbrightLayers) -
Method Summary
Modifier and TypeMethodDescriptionbake
(IModelConfiguration owner, ModelBakery bakery, 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
(List<RenderMaterial> textures, TransformationMatrix transform, Function<RenderMaterial, TextureAtlasSprite> spriteGetter) static com.google.common.collect.ImmutableList<BakedQuad>
getQuadsForSprites
(List<RenderMaterial> textures, TransformationMatrix transform, Function<RenderMaterial, TextureAtlasSprite> spriteGetter, Set<Integer> fullbrights) private static com.google.common.collect.ImmutableList<RenderMaterial>
getTextures
(IModelConfiguration model) getTextures
(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> 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
public ItemLayerModel(@Nullable com.google.common.collect.ImmutableList<RenderMaterial> textures, com.google.common.collect.ImmutableSet<Integer> fullbrightLayers)
-
-
Method Details
-
getTextures
private static com.google.common.collect.ImmutableList<RenderMaterial> getTextures(IModelConfiguration model) -
bake
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) - Specified by:
bake
in interfaceIModelGeometry<ItemLayerModel>
-
getLayerRenderType
-
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(List<RenderMaterial> textures, TransformationMatrix transform, Function<RenderMaterial, TextureAtlasSprite> spriteGetter) -
getQuadsForSprites
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(List<RenderMaterial> textures, TransformationMatrix transform, Function<RenderMaterial, TextureAtlasSprite> spriteGetter, Set<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 Collection<RenderMaterial> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, 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) -
remap
-
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)
-