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$CachedResourceFactoryintermediary net/minecraft/class_757$class_7760official ges$anamed originalintermediary comp_1038official anamed cacheintermediary comp_1039official c
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Identifier, Resource> The field for thecacherecord component.private final ResourceFactoryThe field for theoriginalrecord component.Fields inherited from interface net.minecraft.resource.ResourceFactory
MISSING -
Constructor Summary
ConstructorsConstructorDescriptionCachedResourceFactory(ResourceFactory resourceFactory, Map<Identifier, Resource> map) -
Method Summary
Modifier and TypeMethodDescriptioncache()Returns the value of thecacherecord component.final booleanIndicates whether some other object is "equal to" this one.Finds and returns the corresponding resource for a resource's identifier.final inthashCode()Returns a hash code value for this object.original()Returns the value of theoriginalrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
getResourcein interfaceResourceFactory- Parameters:
id- the resource identifier to search for- Mappings:
Namespace Name Mixin selector named getResourceLnet/minecraft/resource/ResourceFactory;getResource(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;intermediary method_14486Lnet/minecraft/class_5912;method_14486(Lnet/minecraft/class_2960;)Ljava/util/Optional;official getResourceLauh;getResource(Lakr;)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 theoriginalrecord component.- Returns:
- the value of the
originalrecord component
-
cache
Returns the value of thecacherecord component.- Returns:
- the value of the
cacherecord component
-