Package net.minecraftforge.client.model
Class ItemTextureQuadConverter
- java.lang.Object
-
- net.minecraftforge.client.model.ItemTextureQuadConverter
-
public final class ItemTextureQuadConverter extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ItemTextureQuadConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<BakedQuad>
convertTexture(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Takes a texture and converts it into BakedQuads.static java.util.List<BakedQuad>
convertTexture(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
static java.util.List<BakedQuad>
convertTextureHorizontal(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Scans a texture and converts it into a list of horizontal strips stacked on top of each other.static java.util.List<BakedQuad>
convertTextureHorizontal(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
static java.util.List<BakedQuad>
convertTextureVertical(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Scans a texture and converts it into a list of vertical strips stacked next to each other from left to right.static java.util.List<BakedQuad>
convertTextureVertical(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
static BakedQuad
genQuad(TransformationMatrix transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, Direction facing, int color, int tint)
Generates a Front/Back quad for an itemmodel.static BakedQuad
genQuad(TransformationMatrix transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, Direction facing, int color, int tint, int luminosity)
private static boolean
isVisible(int color)
private static BakedQuad
putQuad(TransformationMatrix transform, Direction side, TextureAtlasSprite sprite, int color, int tint, float x1, float y1, float x2, float y2, float z, float u1, float v1, float u2, float v2, int luminosity)
private static void
putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v, int color, int luminosity)
-
-
-
Method Detail
-
convertTexture
public static java.util.List<BakedQuad> convertTexture(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Takes a texture and converts it into BakedQuads. The conversion is done by scanning the texture horizontally and vertically and creating "strips" of the texture. Strips that are of the same size and follow each other are converted into one bigger quad. The resulting list of quads is the texture represented as a list of horizontal OR vertical quads, depending on which creates less quads. If the amount of quads is equal, horizontal is preferred.- Parameters:
template
- The input texture to convertsprite
- The texture whose UVs shall be used- Returns:
- The generated quads.
-
convertTexture
public static java.util.List<BakedQuad> convertTexture(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
-
convertTextureHorizontal
public static java.util.List<BakedQuad> convertTextureHorizontal(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Scans a texture and converts it into a list of horizontal strips stacked on top of each other. The height of the strips is as big as possible.
-
convertTextureHorizontal
public static java.util.List<BakedQuad> convertTextureHorizontal(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
-
convertTextureVertical
public static java.util.List<BakedQuad> convertTextureVertical(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint)
Scans a texture and converts it into a list of vertical strips stacked next to each other from left to right. The width of the strips is as big as possible.
-
convertTextureVertical
public static java.util.List<BakedQuad> convertTextureVertical(TransformationMatrix transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, Direction facing, int color, int tint, int luminosity)
-
isVisible
private static boolean isVisible(int color)
-
genQuad
public static BakedQuad genQuad(TransformationMatrix transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, Direction facing, int color, int tint)
Generates a Front/Back quad for an itemmodel. Therefore only supports facing NORTH and SOUTH. Coordinates are [0,16] to match the usual coordinates used in TextureAtlasSprites
-
genQuad
public static BakedQuad genQuad(TransformationMatrix transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, Direction facing, int color, int tint, int luminosity)
-
putQuad
private static BakedQuad putQuad(TransformationMatrix transform, Direction side, TextureAtlasSprite sprite, int color, int tint, float x1, float y1, float x2, float y2, float z, float u1, float v1, float u2, float v2, int luminosity)
-
putVertex
private static void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v, int color, int luminosity)
-
-