Class FaceBuilder
java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.FaceBuilder
Instantiate this class in order to provide a set of
faces to be rendered for an element of a JSON model.-
Constructor Summary
ConstructorsConstructorDescriptionFaceBuilder(String textureKey) FaceBuilder(net.minecraft.data.models.model.TextureSlot texture) Create a new face builder for the given texture key. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectbuild()withCulling(@Nullable net.minecraft.core.Direction cullFace) Specifies whether this face need not be rendered when there is a block adjacent to it in the specified position.withRotation(net.minecraft.data.models.blockstates.VariantProperties.Rotation rotation) Specifies a texture rotation for the face being built.withTintIndex(int tintIndex) Specified a tint index for this face.withUv(int x1, int y1, int x2, int y2) Specifies the area of the texture to use for the face being built, given in terms of individual vector components.withUv(org.joml.Vector2i u, org.joml.Vector2i v) Specifies the area of the texture to use for the face being built, given in terms of a pair of 2D vectors.withUv(org.joml.Vector4i uv) Specifies the area of the texture to use for the face being built.
-
Constructor Details
-
FaceBuilder
public FaceBuilder(net.minecraft.data.models.model.TextureSlot texture) Create a new face builder for the given texture key.- Parameters:
texture- A key corresponding to the texture to be applied for this element face.
-
FaceBuilder
-
-
Method Details
-
withUv
Specifies the area of the texture to use for the face being built. Defaults to the zero vector, in which case the UV is automatically determined based on the position of the element.- Parameters:
uv- The UV coordinates to use for this face texture, given as aVector4i.
-
withUv
Specifies the area of the texture to use for the face being built, given in terms of a pair of 2D vectors. Defaults to the zero vector, in which case the UV is automatically determined based on the position of the element. -
withUv
Specifies the area of the texture to use for the face being built, given in terms of individual vector components. Defaults to the zero vector, in which case the UV is automatically determined based on the position of the element. -
withCulling
Specifies whether this face need not be rendered when there is a block adjacent to it in the specified position.- Parameters:
cullFace- The position from which an adjacent block should cull this face, ornullto never hide (default).
-
withRotation
public FaceBuilder withRotation(net.minecraft.data.models.blockstates.VariantProperties.Rotation rotation) Specifies a texture rotation for the face being built. Only accepts quarter-turns. -
withTintIndex
Specified a tint index for this face. Tint indexes are hardcoded into a respective item/block and correspond to some colour to be applied to a given face texture as defined in its class. Defaults to -1 (no tint index). -
build
@Internal public com.google.gson.JsonObject build()
-