public final class ItemLayerModel extends java.lang.Object implements IModelGeometry<ItemLayerModel>
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.Modifier and Type | Class and Description |
---|---|
private static class |
ItemLayerModel.FaceData |
static class |
ItemLayerModel.Loader |
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableSet<java.lang.Integer> |
fullbrightLayers |
private static Direction[] |
HORIZONTALS |
static ItemLayerModel |
INSTANCE |
private com.google.common.collect.ImmutableList<Material> |
textures |
private static Direction[] |
VERTICALS |
Constructor and Description |
---|
ItemLayerModel() |
ItemLayerModel(com.google.common.collect.ImmutableList<Material> textures) |
ItemLayerModel(com.google.common.collect.ImmutableList<Material> textures,
com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers) |
Modifier and Type | Method and Description |
---|---|
IBakedModel |
bake(IModelConfiguration owner,
ModelBakery bakery,
java.util.function.Function<Material,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 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<Material> textures,
TransformationMatrix transform,
java.util.function.Function<Material,TextureAtlasSprite> spriteGetter) |
static com.google.common.collect.ImmutableList<BakedQuad> |
getQuadsForSprites(java.util.List<Material> textures,
TransformationMatrix transform,
java.util.function.Function<Material,TextureAtlasSprite> spriteGetter,
java.util.Set<java.lang.Integer> fullbrights) |
private static com.google.common.collect.ImmutableList<Material> |
getTextures(IModelConfiguration model) |
java.util.Collection<Material> |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPart, getParts
public static final ItemLayerModel INSTANCE
private static final Direction[] HORIZONTALS
private static final Direction[] VERTICALS
private com.google.common.collect.ImmutableList<Material> textures
private final com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers
public ItemLayerModel()
public ItemLayerModel(com.google.common.collect.ImmutableList<Material> textures)
public ItemLayerModel(@Nullable com.google.common.collect.ImmutableList<Material> textures, com.google.common.collect.ImmutableSet<java.lang.Integer> fullbrightLayers)
private static com.google.common.collect.ImmutableList<Material> getTextures(IModelConfiguration model)
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, java.util.function.Function<Material,TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
bake
in interface IModelGeometry<ItemLayerModel>
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(java.util.List<Material> textures, TransformationMatrix transform, java.util.function.Function<Material,TextureAtlasSprite> spriteGetter)
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprites(java.util.List<Material> textures, TransformationMatrix transform, java.util.function.Function<Material,TextureAtlasSprite> spriteGetter, java.util.Set<java.lang.Integer> fullbrights)
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform)
public static com.google.common.collect.ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, TransformationMatrix transform, boolean fullbright)
public java.util.Collection<Material> 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)
getTextures
in interface IModelGeometry<ItemLayerModel>
private static BakedQuad buildSideQuad(TransformationMatrix transform, Direction side, int tint, TextureAtlasSprite sprite, int u, int v, int size, boolean fullbright)
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 void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v, int uLight, int vLight)