Package com.samsthenerd.inline.utils
Class EntityCradle
java.lang.Object
com.samsthenerd.inline.utils.EntityCradle
- Direct Known Subclasses:
EntTypeCradle
,NbtCradle
,PlayerCradle
A fancy entity supplier with serialization.
EntityCradle is generally server safe, although calls to getEntity(World)
aren't guaranteed to be.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
EntityCradle.CradleType<C extends EntityCradle>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends EntityCradle.CradleType>
TaddCradleType
(T cradleType) abstract net.minecraft.entity.Entity
getEntity
(net.minecraft.world.World world) Supplies an entity wrapped by the cradle.getId()
Gets an id representing this entity in some way.abstract EntityCradle.CradleType<?>
getType()
-
Field Details
-
CRADLE_CODEC
-
-
Constructor Details
-
EntityCradle
public EntityCradle()
-
-
Method Details
-
getType
-
getEntity
@Nullable public abstract net.minecraft.entity.Entity getEntity(net.minecraft.world.World world) Supplies an entity wrapped by the cradle. This isn't guaranteed to be server-safe.Implementations should try to cache their entity if possible.
- Parameters:
world
-- Returns:
- an entity based on this cradle
-
getId
Gets an id representing this entity in some way. This is used for texture caching on glows (and maybe other stuff in the future).- Returns:
- string that can be used in an identifier/resloc.
-
addCradleType
-