java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.FaceBuilder

public class FaceBuilder extends Object
Instantiate this class in order to provide a set of faces to be rendered for an element of a JSON model.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FaceBuilder(String textureKey)
     
    FaceBuilder(net.minecraft.data.models.model.TextureSlot texture)
    Create a new face builder for the given texture key.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gson.JsonObject
     
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public FaceBuilder(String textureKey)
  • Method Details

    • withUv

      public FaceBuilder withUv(org.joml.Vector4i uv)
      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 a Vector4i.
    • withUv

      public FaceBuilder 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. Defaults to the zero vector, in which case the UV is automatically determined based on the position of the element.
    • withUv

      public FaceBuilder 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. Defaults to the zero vector, in which case the UV is automatically determined based on the position of the element.
    • withCulling

      public FaceBuilder withCulling(@Nullable @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.
      Parameters:
      cullFace - The position from which an adjacent block should cull this face, or null to 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

      public FaceBuilder withTintIndex(int tintIndex)
      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()