类 NewRegistryEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.registries.NewRegistryEvent
所有已实现的接口:
net.neoforged.fml.event.IModBusEvent

public class NewRegistryEvent extends net.neoforged.bus.api.Event implements net.neoforged.fml.event.IModBusEvent
Fired when new registries can be constructed and registered. This event is fired to register builtin registries, like the registries in BuiltInRegistries. Builtin registries are registries which can only load entries registered in code.

For registering datapack registries that only load entries through JSON, see DataPackRegistryEvent.NewRegistry.

This event is fired on the mod-specific event bus, on both logical sides.

另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • NewRegistryEvent

      NewRegistryEvent()
  • 方法详细资料

    • create

      public <T> Registry<T> create(RegistryBuilder<T> builder)
      Creates a registry using the builder and registers it.
      参数:
      builder - the builder to turn into a Registry
      返回:
      the built Registry
    • register

      public <T> void register(Registry<T> registry)
      Registers an already-created registry. This allows storing registries in static final fields and registering them later.
      参数:
      registry - the registry to register
    • fill

      void fill()
    • registerToRootRegistry

      private void registerToRootRegistry(Registry<?> registry)