Class Resource

java.lang.Object
net.minecraft.resource.Resource

public class Resource extends Object
A resource of binary data.

The resource must be closed before disposal to avoid resource leaks.

See Also:
Mappings:
Namespace Name
named net/minecraft/resource/Resource
intermediary net/minecraft/class_3298
official aun
  • Field Details

    • pack

      private final ResourcePack pack
      Mappings:
      Namespace Name Mixin selector
      named pack Lnet/minecraft/resource/Resource;pack:Lnet/minecraft/resource/ResourcePack;
      intermediary field_40054 Lnet/minecraft/class_3298;field_40054:Lnet/minecraft/class_3262;
      official a Laun;a:Latb;
    • inputSupplier

      private final InputSupplier<InputStream> inputSupplier
      Mappings:
      Namespace Name Mixin selector
      named inputSupplier Lnet/minecraft/resource/Resource;inputSupplier:Lnet/minecraft/resource/InputSupplier;
      intermediary field_38685 Lnet/minecraft/class_3298;field_38685:Lnet/minecraft/class_7367;
      official b Laun;b:Lauh;
    • metadataSupplier

      private final InputSupplier<ResourceMetadata> metadataSupplier
      Mappings:
      Namespace Name Mixin selector
      named metadataSupplier Lnet/minecraft/resource/Resource;metadataSupplier:Lnet/minecraft/resource/InputSupplier;
      intermediary field_38686 Lnet/minecraft/class_3298;field_38686:Lnet/minecraft/class_7367;
      official c Laun;c:Lauh;
    • metadata

      Mappings:
      Namespace Name Mixin selector
      named metadata Lnet/minecraft/resource/Resource;metadata:Lnet/minecraft/resource/metadata/ResourceMetadata;
      intermediary field_38687 Lnet/minecraft/class_3298;field_38687:Lnet/minecraft/class_7368;
      official d Laun;d:Laur;
  • Constructor Details

    • Resource

      public Resource(ResourcePack pack, InputSupplier<InputStream> inputSupplier, InputSupplier<ResourceMetadata> metadataSupplier)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/resource/Resource;<init>(Lnet/minecraft/resource/ResourcePack;Lnet/minecraft/resource/InputSupplier;Lnet/minecraft/resource/InputSupplier;)V
      intermediary <init> Lnet/minecraft/class_3298;<init>(Lnet/minecraft/class_3262;Lnet/minecraft/class_7367;Lnet/minecraft/class_7367;)V
      official <init> Laun;<init>(Latb;Lauh;Lauh;)V
    • Resource

      public Resource(ResourcePack pack, InputSupplier<InputStream> inputSupplier)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/resource/Resource;<init>(Lnet/minecraft/resource/ResourcePack;Lnet/minecraft/resource/InputSupplier;)V
      intermediary <init> Lnet/minecraft/class_3298;<init>(Lnet/minecraft/class_3262;Lnet/minecraft/class_7367;)V
      official <init> Laun;<init>(Latb;Lauh;)V
  • Method Details

    • getPack

      public ResourcePack getPack()
      Mappings:
      Namespace Name Mixin selector
      named getPack Lnet/minecraft/resource/Resource;getPack()Lnet/minecraft/resource/ResourcePack;
      intermediary method_45304 Lnet/minecraft/class_3298;method_45304()Lnet/minecraft/class_3262;
      official a Laun;a()Latb;
    • getPackId

      public String getPackId()
      Returns the ID of the pack this resource is from.
      Returns:
      the ID of the pack this resource is from
      Mappings:
      Namespace Name Mixin selector
      named getPackId Lnet/minecraft/resource/Resource;getPackId()Ljava/lang/String;
      intermediary method_14480 Lnet/minecraft/class_3298;method_14480()Ljava/lang/String;
      official b Laun;b()Ljava/lang/String;
    • getKnownPackInfo

      public Optional<VersionedIdentifier> getKnownPackInfo()
      Mappings:
      Namespace Name Mixin selector
      named getKnownPackInfo Lnet/minecraft/resource/Resource;getKnownPackInfo()Ljava/util/Optional;
      intermediary method_56936 Lnet/minecraft/class_3298;method_56936()Ljava/util/Optional;
      official c Laun;c()Ljava/util/Optional;
    • getInputStream

      public InputStream getInputStream() throws IOException
      Returns the input stream of this resource.

      This input stream is closed when this resource is closed.

      Returns:
      the input stream of this resource
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named getInputStream Lnet/minecraft/resource/Resource;getInputStream()Ljava/io/InputStream;
      intermediary method_14482 Lnet/minecraft/class_3298;method_14482()Ljava/io/InputStream;
      official d Laun;d()Ljava/io/InputStream;
    • getReader

      public BufferedReader getReader() throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named getReader Lnet/minecraft/resource/Resource;getReader()Ljava/io/BufferedReader;
      intermediary method_43039 Lnet/minecraft/class_3298;method_43039()Ljava/io/BufferedReader;
      official e Laun;e()Ljava/io/BufferedReader;
    • getMetadata

      public ResourceMetadata getMetadata() throws IOException
      Returns the metadata for the resource.

      The metadata must then be decoded using ResourceMetadata.decode(ResourceMetadataReader) before using.

      Returns:
      the metadata for the resource
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named getMetadata Lnet/minecraft/resource/Resource;getMetadata()Lnet/minecraft/resource/metadata/ResourceMetadata;
      intermediary method_14481 Lnet/minecraft/class_3298;method_14481()Lnet/minecraft/class_7368;
      official f Laun;f()Laur;