Class CompositeModelBuilder
java.lang.Object
net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
net.neoforged.neoforge.client.model.generators.loaders.CompositeModelBuilder
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<String, com.mojang.datafixers.util.Either<ResourceLocation, CompositeModelBuilder.InlineChild>> Fields inherited from class net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
allowInlineElements, loaderId, visibility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchild
(String name, ResourceLocation model) Add a child model by reference.protected CustomLoaderBuilder
Returns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate
.inlineChild
(String name, ModelTemplate template, TextureMapping textures) Add an inline child model.itemRenderOrder
(String... names) com.google.gson.JsonObject
toJson
(com.google.gson.JsonObject json) Methods inherited from class net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
optional, serializeNestedTemplate, visibility
-
Field Details
-
childModels
private final Map<String,com.mojang.datafixers.util.Either<ResourceLocation, childModelsCompositeModelBuilder.InlineChild>> -
itemRenderOrder
-
-
Constructor Details
-
CompositeModelBuilder
public CompositeModelBuilder()
-
-
Method Details
-
child
Add a child model by reference. The child model will be loaded from a separate file at the given location- Parameters:
name
- The part name of the childmodel
- The child model's path relative to the models folder
-
inlineChild
public CompositeModelBuilder inlineChild(String name, ModelTemplate template, TextureMapping textures) Add an inline child model. The child model will be loaded from a nested object in the same JSON file- Parameters:
name
- The part name of the childtemplate
- TheModelTemplate
to create the child model fromtextures
- TheTextureMapping
this child model uses
-
itemRenderOrder
-
copyInternal
Description copied from class:CustomLoaderBuilder
Returns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate
.- Specified by:
copyInternal
in classCustomLoaderBuilder
-
toJson
public com.google.gson.JsonObject toJson(com.google.gson.JsonObject json) - Overrides:
toJson
in classCustomLoaderBuilder
-