Class ModelBuilder.ElementBuilder
java.lang.Object
net.minecraftforge.client.model.generators.ModelBuilder.ElementBuilder
- Enclosing class:
- ModelBuilder<T extends ModelBuilder<T>>
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassclass
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate intprivate booleanprivate intprivate final Map<Direction,ModelBuilder<T>.ElementBuilder.FaceBuilder> private org.joml.Vector3fprivate booleanprivate ModelBuilder<T>.ElementBuilder.RotationBuilderprivate booleanprivate intprivate org.joml.Vector3f
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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()calculateNormals(boolean calc) Sets whether we should calculate actual normals for the faces of this model or inherit them from facing the way vanilla doescolor(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- 
fromprivate org.joml.Vector3f from
- 
toprivate org.joml.Vector3f to
- 
facesprivate final Map<Direction,ModelBuilder<T extends ModelBuilder<T>>.ElementBuilder.FaceBuilder> faces
- 
rotation
- 
shadeprivate boolean shade
- 
colorprivate int color
- 
blockLightprivate int blockLight
- 
skyLightprivate int skyLight
- 
hasAmbientOcclusionprivate boolean hasAmbientOcclusion
- 
calculateNormalsprivate boolean calculateNormals
 
- 
- 
Constructor Details- 
ElementBuilderpublic ElementBuilder()
 
- 
- 
Method Details- 
validateCoordinateprivate void validateCoordinate(float coord, char name) 
- 
validatePositionprivate void validatePosition(org.joml.Vector3f pos) 
- 
fromSet the "from" position for this element.- Parameters:
- x- x-position for this vector
- y- y-position for this vector
- z- 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)
 
- 
toSet the "to" position for this element.- Parameters:
- x- x-position for this vector
- y- y-position for this vector
- z- 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)
 
- 
faceReturn or create the face builder for the given direction.- Parameters:
- dir- the direction
- Returns:
- the face builder for the given direction
- Throws:
- NullPointerException- if- diris- null
 
- 
rotation
- 
shade
- 
allFacespublic 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- if- actionis- null
 
- 
facespublic 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- if- actionis- null
 
- 
textureAllTexture 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- if- textureis- null
 
- 
textureTexture all existing faces in the current element with the given texture.- Parameters:
- texture- the texture
- Returns:
- this builder
- Throws:
- NullPointerException- if- textureis- null
 
- 
cubeCreate 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- if- textureis- null
 
- 
emissivitySet 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 light
- skyLight- the sky light
- Returns:
- this builder
 
- 
colorSets the color of the element.- Parameters:
- color- the color in ARGB format.
- Returns:
- this builder
 
- 
aoSet the ambient occlusion of the element.- Parameters:
- ao- the ambient occlusion
- Returns:
- this builder
 
- 
calculateNormalsSets whether we should calculate actual normals for the faces of this model or inherit them from facing the way vanilla does- Parameters:
- calc- whether to calculate normals
- Returns:
- this builder
 
- 
addTexture
- 
buildBlockElement build()
- 
end
 
-