Class ModelBuilder.ElementBuilder
java.lang.Object
net.minecraftforge.client.model.generators.ModelBuilder.ElementBuilder
- Enclosing class:
- ModelBuilder<T extends ModelBuilder<T>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate final Map<Direction,ModelBuilder<T>.ElementBuilder.FaceBuilder> private org.joml.Vector3fprivate booleanprivate ModelBuilder<T>.ElementBuilder.RotationBuilderprivate booleanprivate intprivate org.joml.Vector3f -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BiConsumer<Direction,ModelBuilder<T>.ElementBuilder.FaceBuilder> addTexture(String texture) Modify all possible faces dynamically using a function, creating new faces as necessary.ao(boolean ao) Set the ambient occlusion of the element.(package private) BlockElementbuild()color(int color) Sets the color of the element.Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.emissivity(int blockLight, int skyLight) Set the block and sky light of the element (0-15).end()Return or create the face builder for the given direction.faces(BiConsumer<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.private voidvalidateCoordinate(float coord, char name) private voidvalidatePosition(org.joml.Vector3f pos)
-
Field Details
-
from
private org.joml.Vector3f from -
to
private org.joml.Vector3f to -
faces
private final Map<Direction,ModelBuilder<T extends ModelBuilder<T>>.ElementBuilder.FaceBuilder> faces -
rotation
-
shade
private boolean shade -
color
private int color -
blockLight
private int blockLight -
skyLight
private int skyLight -
hasAmbientOcclusion
private boolean hasAmbientOcclusion
-
-
Constructor Details
-
ElementBuilder
public ElementBuilder()
-
-
Method Details
-
validateCoordinate
private void validateCoordinate(float coord, char name) -
validatePosition
private void validatePosition(org.joml.Vector3f pos) -
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<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<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
-
emissivity
Set the block and sky light of the element (0-15). Traditional "emissivity" values were set both of these to the same value.- Parameters:
blockLight- the block lightskyLight- the sky light- Returns:
- this builder
-
color
Sets the color of the element.- Parameters:
color- the color in ARGB format.- Returns:
- this builder
-
ao
Set the ambient occlusion of the element.- Parameters:
ao- the ambient occlusion- Returns:
- this builder
-
addTexture
-
build
BlockElement build() -
end
-