56 lines
1.4 KiB
Java
56 lines
1.4 KiB
Java
package net.minecraft.client.renderer.block.model;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
import net.minecraft.core.Direction;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class BakedQuad {
|
|
/**
|
|
* Joined 4 vertex records, each stores packed data according to the VertexFormat of the quad. Vanilla minecraft uses DefaultVertexFormats.BLOCK, Forge uses (usually) ITEM, use BakedQuad.getFormat() to get the correct format.
|
|
*/
|
|
protected final int[] vertices;
|
|
protected final int tintIndex;
|
|
protected final Direction direction;
|
|
protected final TextureAtlasSprite sprite;
|
|
private final boolean shade;
|
|
private final int lightEmission;
|
|
|
|
public BakedQuad(int[] verticies, int tintIndex, Direction direction, TextureAtlasSprite sprite, boolean shade, int lightEmission) {
|
|
this.vertices = verticies;
|
|
this.tintIndex = tintIndex;
|
|
this.direction = direction;
|
|
this.sprite = sprite;
|
|
this.shade = shade;
|
|
this.lightEmission = lightEmission;
|
|
}
|
|
|
|
public TextureAtlasSprite getSprite() {
|
|
return this.sprite;
|
|
}
|
|
|
|
public int[] getVertices() {
|
|
return this.vertices;
|
|
}
|
|
|
|
public boolean isTinted() {
|
|
return this.tintIndex != -1;
|
|
}
|
|
|
|
public int getTintIndex() {
|
|
return this.tintIndex;
|
|
}
|
|
|
|
public Direction getDirection() {
|
|
return this.direction;
|
|
}
|
|
|
|
public boolean isShade() {
|
|
return this.shade;
|
|
}
|
|
|
|
public int getLightEmission() {
|
|
return this.lightEmission;
|
|
}
|
|
}
|