public class ModelDataMap extends java.lang.Object implements IModelData
Modifier and Type | Class and Description |
---|---|
static class |
ModelDataMap.Builder |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<ModelProperty<?>,java.lang.Object> |
backingMap |
Modifier | Constructor and Description |
---|---|
private |
ModelDataMap(java.util.Map<ModelProperty<?>,java.lang.Object> map) |
Modifier and Type | Method and Description |
---|---|
<T> T |
getData(ModelProperty<T> prop) |
boolean |
hasProperty(ModelProperty<?> prop)
Check if this data has a property, even if the value is
null . |
<T> T |
setData(ModelProperty<T> prop,
T data) |
private final java.util.Map<ModelProperty<?>,java.lang.Object> backingMap
private ModelDataMap(java.util.Map<ModelProperty<?>,java.lang.Object> map)
public boolean hasProperty(ModelProperty<?> prop)
IModelData
null
. 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 return null
even if this method returns true
.
hasProperty
in interface IModelData
prop
- The property to check for inclusion in this model datatrue
if this data has the given property, even if no value is presentpublic <T> T getData(ModelProperty<T> prop)
getData
in interface IModelData
public <T> T setData(ModelProperty<T> prop, T data)
setData
in interface IModelData