Interface RegistryBridge


public interface RegistryBridge
Loader-specific registration backend.

Fabric registers eagerly against the vanilla registry; Forge/NeoForge collect into a DeferredRegister flushed on their mod event bus. Each loader module provides one implementation via ServiceLoader.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(Object modEventBus)
    Hooks deferred registration into the loader (mod event bus on Forge/NeoForge; no-op on Fabric).
    default Platform
    Which loader this bridge is for (used to pick among several in one jar).
    <T> Supplier<T>
    register(net.minecraft.core.Registry<T> registry, net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, String modId, String name, Supplier<T> factory)
    Registers factory under modId:name in registry.
  • Method Details

    • platform

      default Platform platform()
      Which loader this bridge is for (used to pick among several in one jar).
    • register

      <T> Supplier<T> register(net.minecraft.core.Registry<T> registry, net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, String modId, String name, Supplier<T> factory)
      Registers factory under modId:name in registry. The factory must not run before registration time.
    • init

      void init(Object modEventBus)
      Hooks deferred registration into the loader (mod event bus on Forge/NeoForge; no-op on Fabric). Called once by the loader entrypoint.