类 ModelBuilder<T extends ModelBuilder<T>>
java.lang.Object
net.minecraftforge.client.model.generators.ModelFile
net.minecraftforge.client.model.generators.ModelBuilder<T>
- 类型参数:
T
- Self type, for simpler chaining of methods.
- 直接已知子类:
BlockModelBuilder
,ItemModelBuilder
General purpose model builder, contains all the commonalities between item
and block models.
-
嵌套类概要
嵌套类修饰符和类型类说明class
static enum
class
class
从类继承的嵌套类/接口 net.minecraftforge.client.model.generators.ModelFile
ModelFile.ExistingModelFile, ModelFile.UncheckedModelFile
-
字段概要
字段修饰符和类型字段说明protected boolean
protected CustomLoaderBuilder<T>
protected final List<ModelBuilder<T>.ElementBuilder>
protected final ExistingFileHelper
protected BlockModel.GuiLight
protected @Nullable ModelFile
protected String
private final ModelBuilder<T>.RootTransformsBuilder
protected final ModelBuilder<T>.TransformsBuilder
-
构造器概要
构造器限定符构造器说明protected
ModelBuilder
(ResourceLocation outputLocation, ExistingFileHelper existingFileHelper) -
方法概要
修饰符和类型方法说明ao
(boolean ao) <L extends CustomLoaderBuilder<T>>
LcustomLoader
(BiFunction<T, ExistingFileHelper, L> customLoaderFactory) Use a custom loader instead of the vanilla elements.element()
element
(int index) Get an existing element builderprotected boolean
exists()
int
返回 the number of elements in this model builder。guiLight
(BlockModel.GuiLight light) Set the parent model for the current model.renderType
(String renderType) Set the render type for this model.renderType
(ResourceLocation renderType) Set the render type for this model.private T
self()
private Number
serializeFloat
(float f) private String
serializeLocOrKey
(String tex) private com.google.gson.JsonArray
serializeVector3f
(org.joml.Vector3f vec) Set the texture for a given dictionary key.texture
(String key, ResourceLocation texture) Set the texture for a given dictionary key.com.google.gson.JsonObject
toJson()
从类继承的方法 net.minecraftforge.client.model.generators.ModelFile
assertExistence, getLocation, getUncheckedLocation
-
字段详细资料
-
parent
-
textures
-
transforms
-
existingFileHelper
-
renderType
-
ambientOcclusion
protected boolean ambientOcclusion -
guiLight
-
elements
-
customLoader
-
rootTransforms
-
-
构造器详细资料
-
ModelBuilder
-
-
方法详细资料
-
self
-
exists
protected boolean exists() -
parent
Set the parent model for the current model.- 参数:
parent
- the parent model- 返回:
- this builder
- 抛出:
NullPointerException
- ifparent
isnull
IllegalStateException
- ifparent
does notexist
-
texture
Set the texture for a given dictionary key.- 参数:
key
- the texture keytexture
- the texture, can be another key e.g."#all"
- 返回:
- this builder
- 抛出:
NullPointerException
- ifkey
isnull
NullPointerException
- iftexture
isnull
IllegalStateException
- iftexture
is not a key (does not start with'#'
) and does not exist in any known resource pack
-
texture
Set the texture for a given dictionary key.- 参数:
key
- the texture keytexture
- the texture- 返回:
- this builder
- 抛出:
NullPointerException
- ifkey
isnull
NullPointerException
- iftexture
isnull
IllegalStateException
- iftexture
is not a key (does not start with'#'
) and does not exist in any known resource pack
-
renderType
Set the render type for this model.- 参数:
renderType
- the render type. Must be registered viaRegisterNamedRenderTypesEvent
- 返回:
- this builder
- 抛出:
NullPointerException
- ifrenderType
isnull
-
renderType
Set the render type for this model.- 参数:
renderType
- the render type. Must be registered viaRegisterNamedRenderTypesEvent
- 返回:
- this builder
- 抛出:
NullPointerException
- ifrenderType
isnull
-
transforms
-
ao
-
guiLight
-
element
-
element
Get an existing element builder- 参数:
index
- the index of the existing element builder- 返回:
- the element builder
- 抛出:
IndexOutOfBoundsException
- if index is out of bounds
-
getElementCount
public int getElementCount()返回 the number of elements in this model builder。- 返回:
- the number of elements in this model builder
-
customLoader
public <L extends CustomLoaderBuilder<T>> L customLoader(BiFunction<T, ExistingFileHelper, L> customLoaderFactory) Use a custom loader instead of the vanilla elements.- 参数:
customLoaderFactory
- function that returns the custom loader to set, given this and theexistingFileHelper
- 返回:
- the custom loader builder
-
rootTransforms
-
toJson
@VisibleForTesting public com.google.gson.JsonObject toJson() -
serializeLocOrKey
-
serializeVector3f
private com.google.gson.JsonArray serializeVector3f(org.joml.Vector3f vec) -
serializeFloat
-