Package net.minecraft.resource
Interface ResourceFactory
- All Known Subinterfaces:
LifecycledResourceManager,ResourceManager
- All Known Implementing Classes:
GameRenderer.CachedResourceFactory,LifecycledResourceManagerImpl,NamespaceResourceManager,ReloadableResourceManagerImpl,ResourceManager.Empty
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides resource access.
- Mappings:
Namespace Name official asrintermediary net/minecraft/class_5912named net/minecraft/resource/ResourceFactory
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceFactoryfromMap(Map<Identifier, Resource> map) Finds and returns the corresponding resource for a resource's identifier.default Resourcedefault InputStreamopen(Identifier id) default BufferedReader
-
Field Details
-
MISSING
- Mappings:
Namespace Name Mixin selector official bLasr;b:Lasr;intermediary field_49043Lnet/minecraft/class_5912;field_49043:Lnet/minecraft/class_5912;named MISSINGLnet/minecraft/resource/ResourceFactory;MISSING:Lnet/minecraft/resource/ResourceFactory;
-
-
Method Details
-
getResource
Finds and returns the corresponding resource for a resource's identifier.Starts by scanning each resource pack from highest priority to lowest. If no resource packs were found to contain the requested entry, will return
Optional.empty().The returned resource must be closed to avoid resource leaks.
- Parameters:
id- the resource identifier to search for- Mappings:
Namespace Name Mixin selector official getResourceLasr;getResource(Lajh;)Ljava/util/Optional;intermediary method_14486Lnet/minecraft/class_5912;method_14486(Lnet/minecraft/class_2960;)Ljava/util/Optional;named getResourceLnet/minecraft/resource/ResourceFactory;getResource(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
-
getResourceOrThrow
- Throws:
FileNotFoundException- Mappings:
Namespace Name Mixin selector official getResourceOrThrowLasr;getResourceOrThrow(Lajh;)Lasm;intermediary getResourceOrThrowLnet/minecraft/class_5912;getResourceOrThrow(Lnet/minecraft/class_2960;)Lnet/minecraft/class_3298;named getResourceOrThrowLnet/minecraft/resource/ResourceFactory;getResourceOrThrow(Lnet/minecraft/util/Identifier;)Lnet/minecraft/resource/Resource;
-
open
- Throws:
IOException- Mappings:
Namespace Name Mixin selector official openLasr;open(Lajh;)Ljava/io/InputStream;intermediary openLnet/minecraft/class_5912;open(Lnet/minecraft/class_2960;)Ljava/io/InputStream;named openLnet/minecraft/resource/ResourceFactory;open(Lnet/minecraft/util/Identifier;)Ljava/io/InputStream;
-
openAsReader
- Throws:
IOException- Mappings:
Namespace Name Mixin selector official openAsReaderLasr;openAsReader(Lajh;)Ljava/io/BufferedReader;intermediary openAsReaderLnet/minecraft/class_5912;openAsReader(Lnet/minecraft/class_2960;)Ljava/io/BufferedReader;named openAsReaderLnet/minecraft/resource/ResourceFactory;openAsReader(Lnet/minecraft/util/Identifier;)Ljava/io/BufferedReader;
-
fromMap
- Mappings:
Namespace Name Mixin selector official fromMapLasr;fromMap(Ljava/util/Map;)Lasr;intermediary fromMapLnet/minecraft/class_5912;fromMap(Ljava/util/Map;)Lnet/minecraft/class_5912;named fromMapLnet/minecraft/resource/ResourceFactory;fromMap(Ljava/util/Map;)Lnet/minecraft/resource/ResourceFactory;
-