接口 ResourceManager
-
- 所有超级接口:
ResourceFactory
- 所有已知子接口:
ReloadableResourceManager
public interface ResourceManager extends ResourceFactory
Provides resource loading capabilities to Minecraft.- Mappings:
Namespace Name official adlintermediary net/minecraft/class_3300named net/minecraft/resource/ResourceManager
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static classResourceManager.Empty
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 booleancontainsResource(Identifier id)Checks whether any of the currently-loaded resource packs contain an entry for the given id.Collection<Identifier>findResources(String startingPath, Predicate<String> pathPredicate)Returns a sorted list of identifiers matching a path predicate.Set<String>getAllNamespaces()Gets a set of all namespaces offered by the resource packs loaded by this manager.List<Resource>getAllResources(Identifier id)Gets all of the available resources to the corresponding resource identifier.Stream<ResourcePack>streamResourcePacks()Gets a stream of loaded resource packs in increasing order of priority.-
从接口继承的方法 net.minecraft.resource.ResourceFactory
getResource
-
-
-
-
方法详细资料
-
getAllNamespaces
Set<String> getAllNamespaces()
Gets a set of all namespaces offered by the resource packs loaded by this manager.- Mappings:
Namespace Name Mixin selector official aLadl;a()Ljava/util/Set;intermediary method_14487Lnet/minecraft/class_3300;method_14487()Ljava/util/Set;named getAllNamespacesLnet/minecraft/resource/ResourceManager;getAllNamespaces()Ljava/util/Set;
-
containsResource
boolean containsResource(Identifier id)
Checks whether any of the currently-loaded resource packs contain an entry for the given id.Starts by querying the resource pack with the highest priority to lowest until it finds one that responds to the requested identifier.
- 参数:
id- the resource identifier to search for- Mappings:
Namespace Name Mixin selector official bLadl;b(Lwp;)Zintermediary method_18234Lnet/minecraft/class_3300;method_18234(Lnet/minecraft/class_2960;)Znamed containsResourceLnet/minecraft/resource/ResourceManager;containsResource(Lnet/minecraft/util/Identifier;)Z
-
getAllResources
List<Resource> getAllResources(Identifier id) throws IOException
Gets all of the available resources to the corresponding resource identifier.Resources are returned in load order, or ascending order of priority, so the last element in the returned list is what would be returned normally by
ResourceFactory.getResource(net.minecraft.util.Identifier)Each resource in this returned list must be closed to avoid resource leaks.
- 参数:
id- the resource identifier to search for- 抛出:
FileNotFoundException- if no matching resources could be found (i.e. if the list would be empty)IOException- if resources were found, but any one of them could not be opened to be read.- Mappings:
Namespace Name Mixin selector official cLadl;c(Lwp;)Ljava/util/List;intermediary method_14489Lnet/minecraft/class_3300;method_14489(Lnet/minecraft/class_2960;)Ljava/util/List;named getAllResourcesLnet/minecraft/resource/ResourceManager;getAllResources(Lnet/minecraft/util/Identifier;)Ljava/util/List;
-
findResources
Collection<Identifier> findResources(String startingPath, Predicate<String> pathPredicate)
Returns a sorted list of identifiers matching a path predicate.Scanning begins in
startingPathand each candidate file present under that directory will be offered up to the predicate to decide whether it should be included or not.Elements in the returned list may not, necessarily be unique. Additional effort is advised to ensure that duplicates in the returned list are discarded before loading.
- 参数:
startingPath- the starting path to begin scanning frompathPredicate- a predicate to determine whether a path should be included or not- 返回:
- the list matching identifiers
- Mappings:
Namespace Name Mixin selector official aLadl;a(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Collection;intermediary method_14488Lnet/minecraft/class_3300;method_14488(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Collection;named findResourcesLnet/minecraft/resource/ResourceManager;findResources(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Collection;
-
streamResourcePacks
Stream<ResourcePack> streamResourcePacks()
Gets a stream of loaded resource packs in increasing order of priority.- Mappings:
Namespace Name Mixin selector official bLadl;b()Ljava/util/stream/Stream;intermediary method_29213Lnet/minecraft/class_3300;method_29213()Ljava/util/stream/Stream;named streamResourcePacksLnet/minecraft/resource/ResourceManager;streamResourcePacks()Ljava/util/stream/Stream;
-
-