Class CompositeModel.CompositeModelData

  • All Implemented Interfaces:
    IModelData
    Enclosing class:
    CompositeModel

    public static class CompositeModel.CompositeModelData
    extends ModelDataMap
    A model data container which stores data for child components.
    • Constructor Detail

      • CompositeModelData

        public CompositeModelData()
    • Method Detail

      • get

        public static java.util.Optional<CompositeModel.CompositeModelData> get​(IModelData modelData)
        Helper to get the CompositeModelData from an unknown IModelData instance.
        Parameters:
        modelData - The undetermined instance to get data from
        Returns:
        An optional representing the composite data, if present.
      • get

        public static IModelData get​(IModelData modelData,
                                     java.lang.String name)
        Helper to get child data from an unknown IModelData instance.
        Parameters:
        modelData - The undetermined instance to get data from
        name - The name of the child part to get data for.
        Returns:
        The data for the child, or empty if not available.
      • getSubmodelData

        public IModelData getSubmodelData​(java.lang.String name)
      • putSubmodelData

        public void putSubmodelData​(java.lang.String name,
                                    IModelData data)
      • hasProperty

        public boolean hasProperty​(ModelProperty<?> prop)
        Description copied from interface: IModelData
        Check if this data has a property, even if the value is 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.

        Specified by:
        hasProperty in interface IModelData
        Overrides:
        hasProperty in class ModelDataMap
        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