Interface ResourceManager

All Superinterfaces:
ResourceFactory
All Known Subinterfaces:
LifecycledResourceManager
All Known Implementing Classes:
LifecycledResourceManagerImpl, NamespaceResourceManager, ReloadableResourceManagerImpl, ResourceManager.Empty

public interface ResourceManager extends ResourceFactory
Provides resource loading capabilities to Minecraft.
Mappings:
Namespace Name
official ake
intermediary net/minecraft/class_3300
named net/minecraft/resource/ResourceManager
  • Method Details

    • 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 a Lake;a()Ljava/util/Set;
      intermediary method_14487 Lnet/minecraft/class_3300;method_14487()Ljava/util/Set;
      named getAllNamespaces Lnet/minecraft/resource/ResourceManager;getAllNamespaces()Ljava/util/Set;
    • getAllResources

      List<Resource> getAllResources(Identifier id)
      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.

      Parameters:
      id - the resource identifier to search for
      Mappings:
      Namespace Name Mixin selector
      official a Lake;a(Lacf;)Ljava/util/List;
      intermediary method_14489 Lnet/minecraft/class_3300;method_14489(Lnet/minecraft/class_2960;)Ljava/util/List;
      named getAllResources Lnet/minecraft/resource/ResourceManager;getAllResources(Lnet/minecraft/util/Identifier;)Ljava/util/List;
    • findResources

      Map<Identifier,Resource> findResources(String startingPath, Predicate<Identifier> allowedPathPredicate)
      Returns a sorted list of identifiers matching a path predicate.

      Scanning begins in startingPath and 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.

      Parameters:
      startingPath - the starting path to begin scanning from
      allowedPathPredicate - a predicate to determine whether a path should be included or not
      Returns:
      the list matching identifiers
      Mappings:
      Namespace Name Mixin selector
      official b Lake;b(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
      intermediary method_14488 Lnet/minecraft/class_3300;method_14488(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
      named findResources Lnet/minecraft/resource/ResourceManager;findResources(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
    • findAllResources

      Map<Identifier,List<Resource>> findAllResources(String startingPath, Predicate<Identifier> allowedPathPredicate)
      Mappings:
      Namespace Name Mixin selector
      official c Lake;c(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
      intermediary method_41265 Lnet/minecraft/class_3300;method_41265(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
      named findAllResources Lnet/minecraft/resource/ResourceManager;findAllResources(Ljava/lang/String;Ljava/util/function/Predicate;)Ljava/util/Map;
    • streamResourcePacks

      Stream<ResourcePack> streamResourcePacks()
      Gets a stream of loaded resource packs in increasing order of priority.
      Mappings:
      Namespace Name Mixin selector
      official b Lake;b()Ljava/util/stream/Stream;
      intermediary method_29213 Lnet/minecraft/class_3300;method_29213()Ljava/util/stream/Stream;
      named streamResourcePacks Lnet/minecraft/resource/ResourceManager;streamResourcePacks()Ljava/util/stream/Stream;