Interface ResourceLoader
@NonExtendable
public interface ResourceLoader
Provides various hooks into the resource loader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceReloader.Key<FeatureSet> The resource reloader store key for the currently enabled feature set.static final ResourceReloader.Key<RegistryWrapper.WrapperLookup> The resource reloader store key for the registry lookup. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReloaderOrdering(Identifier firstReloader, Identifier secondReloader) Requests that resource reloaders registered as the first identifier is applied before the other referenced resource reloader.static ResourceLoaderget(ResourceType type) voidregisterReloader(Identifier id, ResourceReloader reloader) Register a resource reloader for a given resource manager type.
-
Field Details
-
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
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
-
registerReloader
Register a resource reloader for a given resource manager type.- Parameters:
id- the identifier of the resource reloaderreloader- the resource reloader- See Also:
-
addReloaderOrdering
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 othersecondReloader- the identifier of the resource reloader that should run after the other- See Also:
-