Interface ResourceFactory

All Known Subinterfaces:
LifecycledResourceManager, ResourceManager
All Known Implementing Classes:
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.

@FunctionalInterface public interface ResourceFactory
Provides resource access.
Mappings:
Namespace Name
named net/minecraft/resource/ResourceFactory
intermediary net/minecraft/class_5912
official aus
  • Field Details Link icon

    • MISSING Link icon

      static final ResourceFactory MISSING
      Mappings:
      Namespace Name Mixin selector
      named MISSING Lnet/minecraft/resource/ResourceFactory;MISSING:Lnet/minecraft/resource/ResourceFactory;
      intermediary field_49043 Lnet/minecraft/class_5912;field_49043:Lnet/minecraft/class_5912;
      official b Laus;b:Laus;
  • Method Details Link icon

    • getResource Link icon

      Optional<Resource> getResource(Identifier id)
      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
      named getResource Lnet/minecraft/resource/ResourceFactory;getResource(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
      intermediary method_14486 Lnet/minecraft/class_5912;method_14486(Lnet/minecraft/class_2960;)Ljava/util/Optional;
      official getResource Laus;getResource(Lakv;)Ljava/util/Optional;
    • getResourceOrThrow Link icon

      default Resource getResourceOrThrow(Identifier id) throws FileNotFoundException
      Throws:
      FileNotFoundException
      Mappings:
      Namespace Name Mixin selector
      named getResourceOrThrow Lnet/minecraft/resource/ResourceFactory;getResourceOrThrow(Lnet/minecraft/util/Identifier;)Lnet/minecraft/resource/Resource;
      intermediary getResourceOrThrow Lnet/minecraft/class_5912;getResourceOrThrow(Lnet/minecraft/class_2960;)Lnet/minecraft/class_3298;
      official getResourceOrThrow Laus;getResourceOrThrow(Lakv;)Laun;
    • open Link icon

      default InputStream open(Identifier id) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named open Lnet/minecraft/resource/ResourceFactory;open(Lnet/minecraft/util/Identifier;)Ljava/io/InputStream;
      intermediary open Lnet/minecraft/class_5912;open(Lnet/minecraft/class_2960;)Ljava/io/InputStream;
      official open Laus;open(Lakv;)Ljava/io/InputStream;
    • openAsReader Link icon

      default BufferedReader openAsReader(Identifier id) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named openAsReader Lnet/minecraft/resource/ResourceFactory;openAsReader(Lnet/minecraft/util/Identifier;)Ljava/io/BufferedReader;
      intermediary openAsReader Lnet/minecraft/class_5912;openAsReader(Lnet/minecraft/class_2960;)Ljava/io/BufferedReader;
      official openAsReader Laus;openAsReader(Lakv;)Ljava/io/BufferedReader;
    • fromMap Link icon

      static ResourceFactory fromMap(Map<Identifier,Resource> map)
      Mappings:
      Namespace Name Mixin selector
      named fromMap Lnet/minecraft/resource/ResourceFactory;fromMap(Ljava/util/Map;)Lnet/minecraft/resource/ResourceFactory;
      intermediary fromMap Lnet/minecraft/class_5912;fromMap(Ljava/util/Map;)Lnet/minecraft/class_5912;
      official fromMap Laus;fromMap(Ljava/util/Map;)Laus;