Class EntityData
java.lang.Object
be.seeseemelk.mockbukkit.entity.data.EntityData
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityData(@NotNull org.bukkit.entity.EntityType type, @NotNull String data) Constructs a newEntityDatawith a specifiedEntityTypeand provided entity data. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetHeight(EntitySubType subType, EntityState state) Shortcut method to get the height of a entitycom.google.gson.JsonElementgetValueFromKey(String key, EntitySubType subType, EntityState state) Gets entity data for a specific key.doublegetWidth(EntitySubType subType, EntityState state) Shortcut method to get the width of a entity
-
Field Details
-
WIDTH
- See Also:
-
HEIGHT
- See Also:
-
-
Constructor Details
-
EntityData
protected EntityData(@NotNull @NotNull org.bukkit.entity.EntityType type, @NotNull @NotNull String data) Constructs a newEntityDatawith a specifiedEntityTypeand 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
-