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 named net/minecraft/client/render/GameRenderer$CachedResourceFactory
intermediary net/minecraft/class_757$class_7760
official gdi$a
named original
intermediary comp_1038
official a
named cache
intermediary comp_1039
official c
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map
<Identifier, Resource> The field for thecache
record component.private final ResourceFactory
The field for theoriginal
record component.Fields inherited from interface net.minecraft.resource.ResourceFactory
MISSING
-
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 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(Lalf;)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
-