Class ConditionalModelLoader
java.lang.Object
net.neoforged.neoforge.client.model.ConditionalModelLoader
- All Implemented Interfaces:
UnbakedModelLoader<UnbakedModel>
public final class ConditionalModelLoader
extends Object
implements UnbakedModelLoader<UnbakedModel>
Loads the model it is specified in only when all specified loading conditions are satisfied, otherwise loads the specified fallback model.
This is primarily intended for models which reference textures from other mods which may not be present.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Identifierstatic final Stringstatic final ConditionalModelLoaderprivate static final FileToIdConverter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(JsonObject json, JsonDeserializationContext ctx) Reads an unbaked model from the passed JSON object.
-
Field Details
-
ID
-
INSTANCE
-
INLINE_KEY
- See Also:
-
FALLBACK_KEY
- See Also:
-
MODEL_LISTER
-
-
Constructor Details
-
ConditionalModelLoader
private ConditionalModelLoader()
-
-
Method Details
-
read
Description copied from interface:UnbakedModelLoaderReads an unbaked model from the passed JSON object.The
JsonDeserializationContextargument can be used to deserialize types that the system already understands. For example,deserializationContext.deserialize(<sub object>, Transformation.class)to parse a transformation, ordeserializationContext.deserialize(<sub object>, UnbakedModel.class)to parse a nested model. The set of supported types can be found in the declaration ofCuboidModel.GSON.- Specified by:
readin interfaceUnbakedModelLoader<UnbakedModel>- Throws:
JsonParseException
-