Package net.minecraft.client.render
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 fnx$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 Summary
Modifier and TypeFieldDescriptionprivate final Map<Identifier,
Resource> The field for thecache
record component.private final ResourceFactory
The field for theoriginal
record component. -
Constructor Summary
ConstructorDescriptionCachedResourceFactory
(ResourceFactory resourceFactory, Map<Identifier, Resource> map) -
Method Summary
Modifier and TypeMethodDescriptioncache()
Returns the value of thecache
record component.final boolean
Indicates whether some other object is "equal to" this one.Finds and returns the corresponding resource for a resource's identifier.final int
hashCode()
Returns a hash code value for this object.original()
Returns the value of theoriginal
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.resource.ResourceFactory
getResourceOrThrow, open, openAsReader
-
Field Details
-
Constructor Details
-
CachedResourceFactory
-
-
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.
- Specified by:
getResource
in interfaceResourceFactory
- Parameters:
id
- the resource identifier to search for- Mappings:
Namespace Name Mixin selector official getResource
Lanw;getResource(Laew;)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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
original
Returns the value of theoriginal
record component.- Returns:
- the value of the
original
record component
-
cache
Returns the value of thecache
record component.- Returns:
- the value of the
cache
record component
-