Class EntityData
java.lang.Object
com.viaversion.viaversion.api.minecraft.entitydata.EntityData
-
Constructor Summary
ConstructorDescriptionEntityData
(int id, EntityDataType dataType, @Nullable Object value) Creates a new entity data instance. -
Method Summary
Modifier and TypeMethodDescriptiondataType()
boolean
@Nullable Object
getValue()
int
hashCode()
int
id()
void
setDataType
(EntityDataType dataType) Sets the entity data type if compatible with the current value.void
Deprecated.void
setId
(int id) void
setTypeAndValue
(EntityDataType dataType, @Nullable Object value) Sets entity data type and value.void
Sets the entity data value if compatible with the current data type.toString()
<T> @Nullable T
value()
-
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
-