Class ConditionalModelBuilder
java.lang.Object
net.neoforged.neoforge.client.model.generators.template.CustomLoaderBuilder
net.neoforged.neoforge.client.model.generators.loaders.ConditionalModelBuilder
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ICondition> private com.mojang.datafixers.util.Either<Identifier, ConditionalModelBuilder.InlineModel> Fields inherited from class CustomLoaderBuilder
allowInlineElements, loaderId, visibility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCondition(ICondition condition) Add a loading condition which must be satisfied for this model to be loaded.protected CustomLoaderBuilderReturns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate.setFallback(Identifier fallback) Specify the model to fall back to when any condition fails, as a reference to another file.setInlineFallback(ModelTemplate template, TextureMapping textures) Specify the model to fall back to when any condition fails, inlined into this model.setInlineModel(ModelTemplate template, TextureMapping textures) Specify the model to use when all conditions succeed, as a nested object.toJson(JsonObject json) Methods inherited from class CustomLoaderBuilder
optional, serializeNestedTemplate, visibility
-
Field Details
-
conditions
-
inlineModel
-
fallback
-
-
Constructor Details
-
ConditionalModelBuilder
public ConditionalModelBuilder()
-
-
Method Details
-
addCondition
Add a loading condition which must be satisfied for this model to be loaded.- Parameters:
condition- The condition to add
-
setInlineModel
Specify the model to use when all conditions succeed, as a nested object.
This is intended to be used when the guarded model uses yet another model loader. Models which do not need another loader should instead specify their elements/textures/etc. on the model template this builder is attached to.
- Parameters:
template- The template to generate the model fromtextures- The texture mapping to generate the model with
-
setFallback
Specify the model to fall back to when any condition fails, as a reference to another file.- Parameters:
fallback- The fallback model- See Also:
-
setInlineFallback
Specify the model to fall back to when any condition fails, inlined into this model.- Parameters:
template- The template to generate the fallback model fromtextures- The texture mapping to generate the fallback model with- See Also:
-
copyInternal
Description copied from class:CustomLoaderBuilderReturns a deep-copy of this builder in order to maintain the immutability nature ofModelTemplate.- Specified by:
copyInternalin classCustomLoaderBuilder
-
toJson
- Overrides:
toJsonin classCustomLoaderBuilder
-