Class EntityData
java.lang.Object
com.viaversion.viaversion.api.minecraft.entitydata.EntityData
-
Constructor Summary
ConstructorsConstructorDescriptionEntityData(int id, EntityDataType dataType, @Nullable Object value) Creates a new entity data instance. -
Method Summary
Modifier and TypeMethodDescriptiondataType()boolean@Nullable ObjectgetValue()inthashCode()intid()voidsetDataType(EntityDataType dataType) Sets the entity data type if compatible with the current value.voidDeprecated.voidsetId(int id) voidsetTypeAndValue(EntityDataType dataType, @Nullable Object value) Sets entity data type and value.voidSets the entity data value if compatible with the current data type.toString()<T> @Nullable Tvalue()
-
Constructor Details
-
EntityData
Creates a new entity data instance.- Parameters:
id- data indexdataType- data typevalue- value if present- Throws:
IllegalArgumentException- if the value and dataType are incompatible
-
-
Method Details
-
id
public int id() -
setId
public void setId(int id) -
dataType
-
setDataType
Sets the entity data type if compatible with the current value.- Parameters:
dataType- entity data type- Throws:
IllegalArgumentException- if the entity data type and current value are incompatible- See Also:
-
value
public <T> @Nullable T value() -
getValue
-
setValue
Sets the entity data value if compatible with the current data type.- Parameters:
value- value- Throws:
IllegalArgumentException- if the value and current dataType are incompatible- See Also:
-
setTypeAndValue
Sets entity data type and value.- Parameters:
dataType- entity data typevalue- value- Throws:
IllegalArgumentException- if the value and dataType are incompatible
-
setDataTypeUnsafe
Deprecated. -
equals
-
hashCode
public int hashCode() -
toString
-