Class ElementBuilder

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

public class ElementBuilder extends Object
Instantiate this class in order to provide any specific elements to a given block/item model JSON.
  • Constructor Details

    • ElementBuilder

      public ElementBuilder(org.joml.Vector3d from, org.joml.Vector3d to)
      Create a new element builder with a given pair of opposite vertices and optional RotationBuilder and shading.
      Parameters:
      from - The vertex to start drawing out a cuboid element from, given as a Vector3d.
      to - The vertex to stop drawing the element at, given as a Vector3d.
    • ElementBuilder

      public ElementBuilder(double fromX, double fromY, double fromZ, double toX, double toY, double toZ)
      Create a new element builder with a given pair of opposite vertices.
      Parameters:
      fromX - The X-coordinate of the vertex to start drawing out a cuboid element from.
      fromY - The Y-coordinate of the vertex to start drawing out a cuboid element from.
      fromZ - The Z-coordinate of the vertex to start drawing out a cuboid element from.
      toX - The X-coordinate of the vertex to stop drawing the element at.
      toY - The Y-coordinate of the vertex to stop drawing the element at.
      toZ - The Z-coordinate of the vertex to stop drawing the element at.
  • Method Details

    • withRotation

      public ElementBuilder withRotation(@Nullable @Nullable RotationBuilder rotation)
      Sets a rotation to be applied to the element being built.
      Parameters:
      rotation - An instance of a RotationBuilder to provide a rotation for the element, or null for no rotation.
    • withShading

      public ElementBuilder withShading(boolean shade)
      Toggles whether to render shadows cast by the element being built.
    • addFace

      public ElementBuilder addFace(net.minecraft.core.Direction face, FaceBuilder builder)
      Provides an element builder with a given FaceBuilder to provide data for a specific face, such as texturing.
      Parameters:
      face - The face to specify this data for.
      builder - An instanced FaceBuilder from which to build this face's data.
    • removeFace

      public ElementBuilder removeFace(net.minecraft.core.Direction face)
      Removes the specified face for this builder.
      Parameters:
      face - The face direction whose FaceBuilder to remove.
    • clearFaces

      public ElementBuilder clearFaces()
      Clears all current faces for this builder.
    • build

      @Internal public com.google.gson.JsonObject build()