Class EntTypeCradle<E extends net.minecraft.entity.Entity>

java.lang.Object
com.samsthenerd.inline.utils.EntityCradle
com.samsthenerd.inline.utils.cradles.EntTypeCradle<E>

public class EntTypeCradle<E extends net.minecraft.entity.Entity> extends EntityCradle
An entity cradle backed by an EntityType identifier.
  • Constructor Details

    • EntTypeCradle

      public EntTypeCradle(net.minecraft.entity.EntityType<E> type)
  • Method Details

    • getId

      public String 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 class EntityCradle
      Returns:
      string that can be used in an identifier/resloc.
    • fromTypeId

      public static Optional<EntTypeCradle> fromTypeId(net.minecraft.util.Identifier id)
    • getEntType

      public net.minecraft.entity.EntityType<E> getEntType()
    • getType

      public EntityCradle.CradleType<?> getType()
      Specified by:
      getType in class EntityCradle
    • 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 class EntityCradle
      Returns:
      an entity based on this cradle