Class ModelBuilder.ElementBuilder
java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.ModelBuilder.ElementBuilder
- Enclosing class:
- ModelBuilder<T extends ModelBuilder<T>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallFaces(BiConsumer<net.minecraft.core.Direction, ModelBuilder<T>.ElementBuilder.FaceBuilder> action) Modify all possible faces dynamically using a function, creating new faces as necessary.Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.end()face(net.minecraft.core.Direction dir) Return or create the face builder for the given direction.faces(BiConsumer<net.minecraft.core.Direction, ModelBuilder<T>.ElementBuilder.FaceBuilder> action) Modify all existing faces dynamically using a function.from(float x, float y, float z) Set the "from" position for this element.rotation()shade(boolean shade) Texture all existing faces in the current element with the given texture.textureAll(String texture) Texture all possible faces in the current element with the given texture, creating new faces where necessary.to(float x, float y, float z) Set the "to" position for this element.
-
Constructor Details
-
ElementBuilder
public ElementBuilder()
-
-
Method Details
-
from
Set the "from" position for this element.- Parameters:
x- x-position for this vectory- y-position for this vectorz- z-position for this vector- Returns:
- this builder
- Throws:
IllegalArgumentException- if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
-
to
Set the "to" position for this element.- Parameters:
x- x-position for this vectory- y-position for this vectorz- z-position for this vector- Returns:
- this builder
- Throws:
IllegalArgumentException- if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
-
face
Return or create the face builder for the given direction.- Parameters:
dir- the direction- Returns:
- the face builder for the given direction
- Throws:
NullPointerException- ifdirisnull
-
rotation
-
shade
-
allFaces
public ModelBuilder<T>.ElementBuilder allFaces(BiConsumer<net.minecraft.core.Direction, ModelBuilder<T>.ElementBuilder.FaceBuilder> action) Modify all possible faces dynamically using a function, creating new faces as necessary.- Parameters:
action- the function to apply to each direction- Returns:
- this builder
- Throws:
NullPointerException- ifactionisnull
-
faces
public ModelBuilder<T>.ElementBuilder faces(BiConsumer<net.minecraft.core.Direction, ModelBuilder<T>.ElementBuilder.FaceBuilder> action) Modify all existing faces dynamically using a function.- Parameters:
action- the function to apply to each direction- Returns:
- this builder
- Throws:
NullPointerException- ifactionisnull
-
textureAll
Texture all possible faces in the current element with the given texture, creating new faces where necessary.- Parameters:
texture- the texture- Returns:
- this builder
- Throws:
NullPointerException- iftextureisnull
-
texture
Texture all existing faces in the current element with the given texture.- Parameters:
texture- the texture- Returns:
- this builder
- Throws:
NullPointerException- iftextureisnull
-
cube
Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.- Parameters:
texture- the texture- Returns:
- this builder
- Throws:
NullPointerException- iftextureisnull
-
end
-