类 DeferredRegister.Entities

java.lang.Object
net.neoforged.neoforge.registries.DeferredRegister<EntityType<?>>
net.neoforged.neoforge.registries.DeferredRegister.Entities
直接已知子类:
DeferredEntityTypes
封闭类:
DeferredRegister<T>

public static class DeferredRegister.Entities extends DeferredRegister<EntityType<?>>
Specialized DeferredRegister for EntityTypes.
  • 构造器详细资料

    • Entities

      protected Entities(String namespace)
  • 方法详细资料

    • registerEntityType

      public <E extends Entity> DeferredHolder<EntityType<?>,EntityType<E>> registerEntityType(String name, EntityType.EntityFactory<E> factory, MobCategory category)
      Convenience method that constructs a builder. Use this to avoid inference issues.
      类型参数:
      E - the type of the entity
      参数:
      name - The name for this entity type. It will automatically have the namespace prefixed.
      factory - The factory used to typically construct the entity when using an existing helper from the type.
      category - The category of the entity, typically MobCategory.MISC for non-living entities, or one of the others for living entities.
      返回:
      A DeferredHolder which reflects the data that will be registered.
    • registerEntityType

      public <E extends Entity> DeferredHolder<EntityType<?>,EntityType<E>> registerEntityType(String name, EntityType.EntityFactory<E> factory, MobCategory category, UnaryOperator<EntityType.Builder<E>> builder)
      Convenience method that constructs a builder for use in the operator. Use this to avoid inference issues.
      类型参数:
      E - the type of the entity
      参数:
      name - The name for this entity type. It will automatically have the namespace prefixed.
      factory - The factory used to typically construct the entity when using an existing helper from the type.
      category - The category of the entity, typically MobCategory.MISC for non-living entities, or one of the others for living entities.
      builder - The unary operator, which is passed a new builder for user operators, then builds it upon registration.
      返回:
      A DeferredHolder which reflects the data that will be registered.