Class EntTypeCradle<E extends net.minecraft.entity.Entity>
java.lang.Object
com.samsthenerd.inline.utils.EntityCradle
com.samsthenerd.inline.utils.cradles.EntTypeCradle<E>
An entity cradle backed by an EntityType identifier.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.samsthenerd.inline.utils.EntityCradle
EntityCradle.CradleType<C extends EntityCradle>
-
Field Summary
Fields inherited from class com.samsthenerd.inline.utils.EntityCradle
CRADLE_CODEC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<EntTypeCradle>
fromTypeId
(net.minecraft.util.Identifier id) net.minecraft.entity.Entity
getEntity
(net.minecraft.world.World world) Supplies an entity wrapped by the cradle.net.minecraft.entity.EntityType<E>
getId()
Gets an id representing this entity in some way.getType()
Methods inherited from class com.samsthenerd.inline.utils.EntityCradle
addCradleType
-
Constructor Details
-
EntTypeCradle
-
-
Method Details
-
getId
Description copied from class:EntityCradle
Gets an id representing this entity in some way. This is used for texture caching on glows (and maybe other stuff in the future).- Overrides:
getId
in classEntityCradle
- Returns:
- string that can be used in an identifier/resloc.
-
fromTypeId
-
getEntType
-
getType
- Specified by:
getType
in classEntityCradle
-
getEntity
public net.minecraft.entity.Entity getEntity(net.minecraft.world.World world) Description copied from class:EntityCradle
Supplies an entity wrapped by the cradle. This isn't guaranteed to be server-safe.Implementations should try to cache their entity if possible.
- Specified by:
getEntity
in classEntityCradle
- Returns:
- an entity based on this cradle
-