Class MultipartModelData
- java.lang.Object
-
- net.minecraftforge.client.model.data.MultipartModelData
-
- All Implemented Interfaces:
IModelData
public class MultipartModelData extends java.lang.Object implements IModelData
-
-
Field Summary
Fields Modifier and Type Field Description static ModelProperty<MultipartModelData>
MULTIPART_DATA
private java.util.Map<IBakedModel,IModelData>
partData
private IModelData
tileData
-
Constructor Summary
Constructors Constructor Description MultipartModelData(IModelData tileData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IModelData
create(java.util.List<org.apache.commons.lang3.tuple.Pair<java.util.function.Predicate<BlockState>,IBakedModel>> selectors, IBlockDisplayReader world, BlockPos pos, BlockState state, IModelData tileData)
<T> T
getData(ModelProperty<T> prop)
IModelData
getPartData(IBakedModel part, IModelData defaultData)
boolean
hasProperty(ModelProperty<?> prop)
Check if this data has a property, even if the value isnull
.static IModelData
resolve(IBakedModel part, IModelData modelData)
<T> T
setData(ModelProperty<T> prop, T data)
void
setPartData(IBakedModel part, IModelData data)
-
-
-
Field Detail
-
MULTIPART_DATA
public static final ModelProperty<MultipartModelData> MULTIPART_DATA
-
tileData
private final IModelData tileData
-
partData
private final java.util.Map<IBakedModel,IModelData> partData
-
-
Constructor Detail
-
MultipartModelData
public MultipartModelData(IModelData tileData)
-
-
Method Detail
-
create
public static IModelData create(java.util.List<org.apache.commons.lang3.tuple.Pair<java.util.function.Predicate<BlockState>,IBakedModel>> selectors, IBlockDisplayReader world, BlockPos pos, BlockState state, IModelData tileData)
-
resolve
public static IModelData resolve(IBakedModel part, IModelData modelData)
-
setPartData
public void setPartData(IBakedModel part, IModelData data)
-
getPartData
@Nullable public IModelData getPartData(IBakedModel part, IModelData defaultData)
-
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
@Nullable public <T> T getData(ModelProperty<T> prop)
- Specified by:
getData
in interfaceIModelData
-
setData
@Nullable public <T> T setData(ModelProperty<T> prop, T data)
- Specified by:
setData
in interfaceIModelData
-
-