Interface ResourceLoader


@NonExtendable public interface ResourceLoader
Provides various hooks into the resource loader.
  • Field Details

    • RELOADER_REGISTRY_LOOKUP_KEY

      static final ResourceReloader.Key<RegistryWrapper.WrapperLookup> RELOADER_REGISTRY_LOOKUP_KEY
      The resource reloader store key for the registry lookup.
      API Note:
      The registry lookup is only available in server data resource reloaders.
    • RELOADER_FEATURE_SET_KEY

      static final ResourceReloader.Key<FeatureSet> RELOADER_FEATURE_SET_KEY
      The resource reloader store key for the currently enabled feature set.
      API Note:
      The feature set is only available in server data resource reloaders.
  • Method Details

    • get

      static ResourceLoader get(ResourceType type)
    • registerReloader

      void registerReloader(Identifier id, ResourceReloader reloader)
      Register a resource reloader for a given resource manager type.
      Parameters:
      id - the identifier of the resource reloader
      reloader - the resource reloader
      See Also:
    • addReloaderOrdering

      void addReloaderOrdering(Identifier firstReloader, Identifier secondReloader)
      Requests that resource reloaders registered as the first identifier is applied before the other referenced resource reloader.

      Incompatible ordering constraints such as cycles will lead to inconsistent behavior: some constraints will be respected and some will be ignored. If this happens, a warning will be logged.

      Please keep in mind that this only takes effect during the application stage!

      Parameters:
      firstReloader - the identifier of the resource reloader that should run before the other
      secondReloader - the identifier of the resource reloader that should run after the other
      See Also: