public interface DataHolder extends DataSerializable, PropertyHolder, CompositeValueStore<DataHolder,DataManipulator<?,?>>
Modifier and Type | Method and Description |
---|---|
void |
setRawData(DataView container)
Attempts to set all data of this
DataHolder according to the
DataContainer 's held information. |
boolean |
validateRawData(DataView container)
Validates the container with known data required to set the raw data to
this
DataHolder . |
getContentVersion, toContainer
getApplicableProperties, getProperty
boolean validateRawData(DataView container)
DataHolder
. If the container is incomplete or contains
invalid data, false
is returned.
This validation should be checked prior to calling
setRawData(DataView)
to avoid exceptions.
container
- The raw data to validatevoid setRawData(DataView container) throws InvalidDataException
DataHolder
according to the
DataContainer
's held information. Using this to modify known
DataManipulator
is unsupported and if the data is invalid, an
InvalidDataException
is thrown.
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 at validating known DataManipulator
s
contained in the data container are made with the assumption that all
necessary data exists.
container
- A container containing all raw data to set on this
data holderInvalidDataException
- If the container is missing or has invalid
data that this holder will refuse