Class ElementBuilder
java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.ElementBuilder
Instantiate this class in order to provide any specific
elements to a given block/item model JSON.-
Constructor Summary
ConstructorsConstructorDescriptionElementBuilder(double fromX, double fromY, double fromZ, double toX, double toY, double toZ) Create a new element builder with a given pair of opposite vertices.ElementBuilder(org.joml.Vector3d from, org.joml.Vector3d to) Create a new element builder with a given pair of opposite vertices and optionalRotationBuilderand shading. -
Method Summary
Modifier and TypeMethodDescriptionaddFace(net.minecraft.core.Direction face, FaceBuilder builder) Provides an element builder with a givenFaceBuilderto provide data for a specific face, such as texturing.com.google.gson.JsonObjectbuild()Clears all current faces for this builder.removeFace(net.minecraft.core.Direction face) Removes the specified face for this builder.withRotation(@Nullable RotationBuilder rotation) Sets a rotation to be applied to the element being built.withShading(boolean shade) Toggles whether to render shadows cast by the element being built.
-
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 optionalRotationBuilderand shading.- Parameters:
from- The vertex to start drawing out a cuboid element from, given as aVector3d.to- The vertex to stop drawing the element at, given as aVector3d.
-
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
Sets a rotation to be applied to the element being built.- Parameters:
rotation- An instance of aRotationBuilderto provide arotationfor the element, ornullfor no rotation.
-
withShading
Toggles whether to render shadows cast by the element being built. -
addFace
Provides an element builder with a givenFaceBuilderto provide data for a specific face, such as texturing.- Parameters:
face- The face to specify this data for.builder- An instancedFaceBuilderfrom which to build this face's data.
-
removeFace
Removes the specified face for this builder.- Parameters:
face- The face direction whoseFaceBuilderto remove.
-
clearFaces
Clears all current faces for this builder. -
build
@Internal public com.google.gson.JsonObject build()
-