Interface SerializableDataHolder.Mutable

    • Method Detail

      • setRawData

        void setRawData​(DataView container)
                 throws InvalidDataException
        Attempts to set all data of this DataHolder according to the DataView's held information. Using this to modify known to be Keys provided dynamically through DataProviders is unsupported. The format of the DataView's contained data is dependent on the type of DataHolder.Mutable this is. In some cases, the format is specified based on a more specific type, such as for EntityTypes, or ItemTypes.

        This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts to validate the provided view is not always possible due to the nature of the data being parsed by the implementation, and only understood by clients. Other cases where the data can be validated and the data is incompatible will end up throwing an InvalidDataException.

        container - A container containing all raw data to set on this data holder
        InvalidDataException - If the container is missing or has invalid data that this holder will refuse