Class ModelBuilder.ElementBuilder
java.lang.Object
net.minecraftforge.client.model.generators.ModelBuilder.ElementBuilder
- Enclosing class:
- ModelBuilder<T extends ModelBuilder<T>>
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<Direction,
ModelBuilder<T>.ElementBuilder.FaceBuilder> private Vector3f
private ModelBuilder<T>.ElementBuilder.RotationBuilder
private boolean
private Vector3f
-
Constructor Summary
-
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.(package private) BlockPart
build()
Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.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 void
validateCoordinate
(float coord, char name) private void
validatePosition
(Vector3f pos)
-
Field Details
-
from
-
to
-
faces
private final Map<Direction,ModelBuilder<T extends ModelBuilder<T>>.ElementBuilder.FaceBuilder> faces -
rotation
-
shade
private boolean shade
-
-
Constructor Details
-
ElementBuilder
public ElementBuilder()
-
-
Method Details
-
validateCoordinate
private void validateCoordinate(float coord, char name) -
validatePosition
-
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
- ifdir
isnull
-
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
- ifaction
isnull
-
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
- ifaction
isnull
-
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
- iftexture
isnull
-
texture
Texture all existing faces in the current element with the given texture.- Parameters:
texture
- the texture- Returns:
- this builder
- Throws:
NullPointerException
- iftexture
isnull
-
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
- iftexture
isnull
-
addTexture
-
build
BlockPart build() -
end
-