Package net.minecraftforge.client.model
Class CompositeModel.ModelDataWrapper
- java.lang.Object
-
- net.minecraftforge.client.model.data.ModelDataMap
-
- net.minecraftforge.client.model.CompositeModel.ModelDataWrapper
-
- All Implemented Interfaces:
IModelData
- Enclosing class:
- CompositeModel
private static class CompositeModel.ModelDataWrapper extends ModelDataMap
Wrapper for an IModelData instance which allows forwarding queries to the parent, but stores any new/modified values itself, avoiding modifications to the parent.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.client.model.data.ModelDataMap
ModelDataMap.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private IModelData
parent
-
Constructor Summary
Constructors Modifier Constructor Description private
ModelDataWrapper(IModelData parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getData(ModelProperty<T> prop)
boolean
hasProperty(ModelProperty<?> prop)
Check if this data has a property, even if the value isnull
.<T> T
setData(ModelProperty<T> prop, T data)
static IModelData
wrap(IModelData parent)
-
-
-
Field Detail
-
parent
private final IModelData parent
-
-
Constructor Detail
-
ModelDataWrapper
private ModelDataWrapper(IModelData parent)
-
-
Method Detail
-
wrap
public static IModelData wrap(IModelData parent)
-
hasProperty
public boolean hasProperty(ModelProperty<?> prop)
Description copied from interface:IModelData
Check if this data has a property, even if the value isnull
. Can be used by code that intends to fill in data for a render pipeline, such as the forge animation system.IMPORTANT:
IModelData.getData(ModelProperty)
can returnnull
even if this method returnstrue
.- Specified by:
hasProperty
in interfaceIModelData
- Overrides:
hasProperty
in classModelDataMap
- Parameters:
prop
- The property to check for inclusion in this model data- Returns:
true
if this data has the given property, even if no value is present
-
getData
@Nullable public <T> T getData(ModelProperty<T> prop)
- Specified by:
getData
in interfaceIModelData
- Overrides:
getData
in classModelDataMap
-
setData
@Nullable public <T> T setData(ModelProperty<T> prop, T data)
- Specified by:
setData
in interfaceIModelData
- Overrides:
setData
in classModelDataMap
-
-