Record Class GameRenderer.CachedResourceFactory

java.lang.Object
java.lang.Record
net.minecraft.client.render.GameRenderer.CachedResourceFactory
Record Components:
original -
cache -
All Implemented Interfaces:
ResourceFactory
Enclosing class:
GameRenderer

@Environment(CLIENT) public static record GameRenderer.CachedResourceFactory(ResourceFactory original, Map<Identifier,Resource> cache) extends Record implements ResourceFactory
Mappings:
Namespace Name
official fdo$a
intermediary net/minecraft/class_757$class_7760
named net/minecraft/client/render/GameRenderer$CachedResourceFactory
official a
intermediary comp_1038
named original
official b
intermediary comp_1039
named cache
  • Field Details

  • Constructor Details

  • Method Details

    • getResource

      public 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.

      Specified by:
      getResource in interface ResourceFactory
      Parameters:
      id - the resource identifier to search for
      Mappings:
      Namespace Name Mixin selector
      official getResource Lakh;getResource(Lacf;)Ljava/util/Optional;
      intermediary method_14486 Lnet/minecraft/class_5912;method_14486(Lnet/minecraft/class_2960;)Ljava/util/Optional;
      named getResource Lnet/minecraft/resource/ResourceFactory;getResource(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • original

      public ResourceFactory original()
      Returns the value of the original record component.
      Returns:
      the value of the original record component
    • cache

      public Map<Identifier,Resource> cache()
      Returns the value of the cache record component.
      Returns:
      the value of the cache record component