Class EntityData
java.lang.Object
be.seeseemelk.mockbukkit.entity.data.EntityData
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EntityData
(@NotNull EntityType type, @NotNull String data) Constructs a newEntityData
with a specifiedEntityType
and provided entity data. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getHeight
(EntitySubType subType, EntityState state) Shortcut method to get the height of a entitycom.google.gson.JsonElement
getValueFromKey
(String key, EntitySubType subType, EntityState state) Gets entity data for a specific key.double
getWidth
(EntitySubType subType, EntityState state) Shortcut method to get the width of a entity
-
Field Details
-
WIDTH
- See Also:
-
HEIGHT
- See Also:
-
-
Constructor Details
-
EntityData
Constructs a newEntityData
with a specifiedEntityType
and provided entity data.- Parameters:
type
- The type of entity to create ondata
- The data of the entity
-
-
Method Details
-
getWidth
Shortcut method to get the width of a entity- Parameters:
subType
- Subtype of entitystate
- State of entity- Returns:
- the width of the entity
-
getHeight
Shortcut method to get the height of a entity- Parameters:
subType
- Subtype of entitystate
- State of entity- Returns:
- The height of the entity
-
getValueFromKey
public com.google.gson.JsonElement getValueFromKey(String key, EntitySubType subType, EntityState state) Gets entity data for a specific key. Defaults to a default state, if the state does not provide a value for the key.- Parameters:
key
- The specific keysubType
- Subtype of entitystate
- State of entity- Returns:
- The value matching the specified key
-