Class ModelBuilder.ElementBuilder
- java.lang.Object
-
- net.minecraftforge.client.model.generators.ModelBuilder.ElementBuilder
-
- Enclosing class:
- ModelBuilder<T extends ModelBuilder<T>>
public class ModelBuilder.ElementBuilder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModelBuilder.ElementBuilder.FaceBuilder
class
ModelBuilder.ElementBuilder.RotationBuilder
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Direction,ModelBuilder.ElementBuilder.FaceBuilder>
faces
private Vector3f
from
private ModelBuilder.ElementBuilder.RotationBuilder
rotation
private boolean
shade
private Vector3f
to
-
Constructor Summary
Constructors Constructor Description ElementBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.function.BiConsumer<Direction,ModelBuilder.ElementBuilder.FaceBuilder>
addTexture(java.lang.String texture)
ModelBuilder.ElementBuilder
allFaces(java.util.function.BiConsumer<Direction,ModelBuilder.ElementBuilder.FaceBuilder> action)
Modify all possible faces dynamically using a function, creating new faces as necessary.(package private) BlockPart
build()
ModelBuilder.ElementBuilder
cube(java.lang.String texture)
Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.T
end()
ModelBuilder.ElementBuilder.FaceBuilder
face(Direction dir)
Return or create the face builder for the given direction.ModelBuilder.ElementBuilder
faces(java.util.function.BiConsumer<Direction,ModelBuilder.ElementBuilder.FaceBuilder> action)
Modify all existing faces dynamically using a function.ModelBuilder.ElementBuilder
from(float x, float y, float z)
Set the "from" position for this element.ModelBuilder.ElementBuilder.RotationBuilder
rotation()
ModelBuilder.ElementBuilder
shade(boolean shade)
ModelBuilder.ElementBuilder
texture(java.lang.String texture)
Texture all existing faces in the current element with the given texture.ModelBuilder.ElementBuilder
textureAll(java.lang.String texture)
Texture all possible faces in the current element with the given texture, creating new faces where necessary.ModelBuilder.ElementBuilder
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 Detail
-
from
private Vector3f from
-
to
private Vector3f to
-
faces
private final java.util.Map<Direction,ModelBuilder.ElementBuilder.FaceBuilder> faces
-
rotation
private ModelBuilder.ElementBuilder.RotationBuilder rotation
-
shade
private boolean shade
-
-
Method Detail
-
validateCoordinate
private void validateCoordinate(float coord, char name)
-
validatePosition
private void validatePosition(Vector3f pos)
-
from
public ModelBuilder.ElementBuilder from(float x, float y, float z)
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:
java.lang.IllegalArgumentException
- if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
-
to
public ModelBuilder.ElementBuilder to(float x, float y, float z)
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:
java.lang.IllegalArgumentException
- if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
-
face
public ModelBuilder.ElementBuilder.FaceBuilder face(Direction dir)
Return or create the face builder for the given direction.- Parameters:
dir
- the direction- Returns:
- the face builder for the given direction
- Throws:
java.lang.NullPointerException
- ifdir
isnull
-
rotation
public ModelBuilder.ElementBuilder.RotationBuilder rotation()
-
shade
public ModelBuilder.ElementBuilder shade(boolean shade)
-
allFaces
public ModelBuilder.ElementBuilder allFaces(java.util.function.BiConsumer<Direction,ModelBuilder.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:
java.lang.NullPointerException
- ifaction
isnull
-
faces
public ModelBuilder.ElementBuilder faces(java.util.function.BiConsumer<Direction,ModelBuilder.ElementBuilder.FaceBuilder> action)
Modify all existing faces dynamically using a function.- Parameters:
action
- the function to apply to each direction- Returns:
- this builder
- Throws:
java.lang.NullPointerException
- ifaction
isnull
-
textureAll
public ModelBuilder.ElementBuilder textureAll(java.lang.String texture)
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:
java.lang.NullPointerException
- iftexture
isnull
-
texture
public ModelBuilder.ElementBuilder texture(java.lang.String texture)
Texture all existing faces in the current element with the given texture.- Parameters:
texture
- the texture- Returns:
- this builder
- Throws:
java.lang.NullPointerException
- iftexture
isnull
-
cube
public ModelBuilder.ElementBuilder cube(java.lang.String texture)
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:
java.lang.NullPointerException
- iftexture
isnull
-
addTexture
private java.util.function.BiConsumer<Direction,ModelBuilder.ElementBuilder.FaceBuilder> addTexture(java.lang.String texture)
-
build
BlockPart build()
-
end
public T end()
-
-