Class ModelDataMap
- java.lang.Object
-
- net.minecraftforge.client.model.data.ModelDataMap
-
- All Implemented Interfaces:
IModelData
- Direct Known Subclasses:
CompositeModel.CompositeModelData
,CompositeModel.ModelDataWrapper
public class ModelDataMap extends java.lang.Object implements IModelData
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModelDataMap.Builder
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ModelProperty<?>,java.lang.Object>
backingMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelDataMap()
private
ModelDataMap(java.util.Map<ModelProperty<?>,java.lang.Object> map)
-
Method Summary
All 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)
-
-
-
Field Detail
-
backingMap
private final java.util.Map<ModelProperty<?>,java.lang.Object> backingMap
-
-
Constructor Detail
-
ModelDataMap
private ModelDataMap(java.util.Map<ModelProperty<?>,java.lang.Object> map)
-
ModelDataMap
protected ModelDataMap()
-
-
Method Detail
-
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
- 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
public <T> T getData(ModelProperty<T> prop)
- Specified by:
getData
in interfaceIModelData
-
setData
public <T> T setData(ModelProperty<T> prop, T data)
- Specified by:
setData
in interfaceIModelData
-
-