类 ConfiguredModel.Builder<T>
java.lang.Object
net.minecraftforge.client.model.generators.ConfiguredModel.Builder<T>
- 类型参数:
T
- the type of the owning builder, which supplied the callback, and will be returned upon completion.
- 封闭类:
ConfiguredModel
A builder for
ConfiguredModel
s, which can contain a callback for
processing the finished result. If no callback is available (e.g. in the case
of ConfiguredModel.builder()
), some methods will not be available.
Multiple models can be configured at once through the use of
nextModel()
.
-
字段概要
字段修饰符和类型字段说明private final @Nullable Function
<ConfiguredModel[], T> private ModelFile
private final List
<ConfiguredModel> private int
private int
private boolean
private int
-
构造器概要
构造器构造器说明Builder()
Builder
(@Nullable Function<ConfiguredModel[], T> callback, List<ConfiguredModel> otherModels) -
方法概要
修饰符和类型方法说明addModel()
Apply the contained callback and return the owning builder object.build()
Build all configured models and return them as an array.Build the most recent model, as ifnextModel()
was never called.Set the underlying model object for this configured model.Complete the current model and return a new builder instance with the same callback, and storing all previously built models.rotationX
(int value) Set the x-rotation for this model.rotationY
(int value) Set the y-rotation for this model.uvLock
(boolean value) weight
(int value) Set the random weight for this model.
-
字段详细资料
-
model
-
callback
-
otherModels
-
rotationX
private int rotationX -
rotationY
private int rotationY -
uvLock
private boolean uvLock -
weight
private int weight
-
-
构造器详细资料
-
Builder
Builder() -
Builder
Builder(@Nullable @Nullable Function<ConfiguredModel[], T> callback, List<ConfiguredModel> otherModels)
-
-
方法详细资料
-
modelFile
Set the underlying model object for this configured model.- 参数:
model
- the model- 返回:
- this builder
- 抛出:
NullPointerException
- ifmodel
isnull
-
rotationX
Set the x-rotation for this model.- 参数:
value
- the x-rotation value- 返回:
- this builder
- 抛出:
IllegalArgumentException
- ifvalue
is not a valid x-rotation (seeBlockModelRotation
)
-
rotationY
Set the y-rotation for this model.- 参数:
value
- the y-rotation value- 返回:
- this builder
- 抛出:
IllegalArgumentException
- ifvalue
is not a valid y-rotation (seeBlockModelRotation
)
-
uvLock
-
weight
Set the random weight for this model.- 参数:
value
- the weight value- 返回:
- this builder
- 抛出:
IllegalArgumentException
- ifvalue
is less than or equal to zero
-
buildLast
Build the most recent model, as ifnextModel()
was never called. Useful for single-model builders.- 返回:
- the most recently configured model
-
build
Build all configured models and return them as an array.- 返回:
- the array of built models.
-
addModel
Apply the contained callback and return the owning builder object. What the callback does is not defined by this class, but most likely it adds the built models to the current variant being configured.Known callbacks include:
- 返回:
- the owning builder object
- 抛出:
NullPointerException
- if there is no owning builder (and thus no callback)
-
nextModel
Complete the current model and return a new builder instance with the same callback, and storing all previously built models.- 返回:
- a new builder for configuring the next model
-