Package net.minecraft.resource
Class ResourceImpl
java.lang.Object
net.minecraft.resource.ResourceImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,Resource
- Mappings:
Namespace Name official aeaintermediary net/minecraft/class_3306named net/minecraft/resource/ResourceImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Identifierprivate InputStreamprivate JsonObjectprivate InputStreamprivate Stringprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionResourceImpl(String packName, Identifier id, InputStream inputStream, @Nullable InputStream metaInputStream) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleangetId()Returns the location of this resource.Returns the input stream of this resource.<T> TgetMetadata(ResourceMetadataReader<T> metaReader)Returns a metadata of this resource by themetaReader, ornullif no such metadata exists.Returns the user-friendly name of the pack this resource is from.inthashCode()booleanReturns if this resource has any metadata.
-
Field Details
-
packName
- Mappings:
Namespace Name Mixin selector official aLaea;a:Ljava/lang/String;intermediary field_14296Lnet/minecraft/class_3306;field_14296:Ljava/lang/String;named packNameLnet/minecraft/resource/ResourceImpl;packName:Ljava/lang/String;
-
id
- Mappings:
Namespace Name Mixin selector official bLaea;b:Lww;intermediary field_14299Lnet/minecraft/class_3306;field_14299:Lnet/minecraft/class_2960;named idLnet/minecraft/resource/ResourceImpl;id:Lnet/minecraft/util/Identifier;
-
inputStream
- Mappings:
Namespace Name Mixin selector official cLaea;c:Ljava/io/InputStream;intermediary field_14298Lnet/minecraft/class_3306;field_14298:Ljava/io/InputStream;named inputStreamLnet/minecraft/resource/ResourceImpl;inputStream:Ljava/io/InputStream;
-
metaInputStream
- Mappings:
Namespace Name Mixin selector official dLaea;d:Ljava/io/InputStream;intermediary field_14300Lnet/minecraft/class_3306;field_14300:Ljava/io/InputStream;named metaInputStreamLnet/minecraft/resource/ResourceImpl;metaInputStream:Ljava/io/InputStream;
-
readMetadata
private boolean readMetadata- Mappings:
Namespace Name Mixin selector official eLaea;e:Zintermediary field_14297Lnet/minecraft/class_3306;field_14297:Znamed readMetadataLnet/minecraft/resource/ResourceImpl;readMetadata:Z
-
metadata
- Mappings:
Namespace Name Mixin selector official fLaea;f:Lcom/google/gson/JsonObject;intermediary field_14302Lnet/minecraft/class_3306;field_14302:Lcom/google/gson/JsonObject;named metadataLnet/minecraft/resource/ResourceImpl;metadata:Lcom/google/gson/JsonObject;
-
-
Constructor Details
-
ResourceImpl
public ResourceImpl(String packName, Identifier id, InputStream inputStream, @Nullable @Nullable InputStream metaInputStream)- Mappings:
Namespace Name Mixin selector official <init>Laea;<init>(Ljava/lang/String;Lww;Ljava/io/InputStream;Ljava/io/InputStream;)Vintermediary <init>Lnet/minecraft/class_3306;<init>(Ljava/lang/String;Lnet/minecraft/class_2960;Ljava/io/InputStream;Ljava/io/InputStream;)Vnamed <init>Lnet/minecraft/resource/ResourceImpl;<init>(Ljava/lang/String;Lnet/minecraft/util/Identifier;Ljava/io/InputStream;Ljava/io/InputStream;)V
-
-
Method Details
-
getId
Returns the location of this resource.Within each resource pack, this location is a unique identifer for a resource; however, in a resource manager, there may be multiple resources with the same location available.
-
getInputStream
Returns the input stream of this resource.This input stream is closed when this resource is closed.
- Specified by:
getInputStreamin interfaceResource- Mappings:
Namespace Name Mixin selector official bLads;b()Ljava/io/InputStream;intermediary method_14482Lnet/minecraft/class_3298;method_14482()Ljava/io/InputStream;named getInputStreamLnet/minecraft/resource/Resource;getInputStream()Ljava/io/InputStream;
-
hasMetadata
public boolean hasMetadata()Returns if this resource has any metadata.- Specified by:
hasMetadatain interfaceResource- Mappings:
Namespace Name Mixin selector official cLads;c()Zintermediary method_14484Lnet/minecraft/class_3298;method_14484()Znamed hasMetadataLnet/minecraft/resource/Resource;hasMetadata()Z
-
getMetadata
Returns a metadata of this resource by themetaReader, ornullif no such metadata exists.- Specified by:
getMetadatain interfaceResource- Parameters:
metaReader- the metadata reader- Mappings:
Namespace Name Mixin selector official aLads;a(Lacz;)Ljava/lang/Object;intermediary method_14481Lnet/minecraft/class_3298;method_14481(Lnet/minecraft/class_3270;)Ljava/lang/Object;named getMetadataLnet/minecraft/resource/Resource;getMetadata(Lnet/minecraft/resource/metadata/ResourceMetadataReader;)Ljava/lang/Object;
-
getResourcePackName
Returns the user-friendly name of the pack this resource is from.- Specified by:
getResourcePackNamein interfaceResource- Mappings:
Namespace Name Mixin selector official dLads;d()Ljava/lang/String;intermediary method_14480Lnet/minecraft/class_3298;method_14480()Ljava/lang/String;named getResourcePackNameLnet/minecraft/resource/Resource;getResourcePackName()Ljava/lang/String;
-
equals
-
hashCode
public int hashCode() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-