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
official ahs
intermediary net/minecraft/class_3298
named net/minecraft/resource/Resource
  • Field Details

    • resourcePackName

      private final String resourcePackName
      Mappings:
      Namespace Name Mixin selector
      official a Lahs;a:Ljava/lang/String;
      intermediary field_38684 Lnet/minecraft/class_3298;field_38684:Ljava/lang/String;
      named resourcePackName Lnet/minecraft/resource/Resource;resourcePackName:Ljava/lang/String;
    • inputSupplier

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

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

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

    • Resource

      public Resource(String resourcePackName, Resource.InputSupplier<InputStream> inputSupplier, Resource.InputSupplier<ResourceMetadata> metadataSupplier)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lahs;<init>(Ljava/lang/String;Lahs$a;Lahs$a;)V
      intermediary <init> Lnet/minecraft/class_3298;<init>(Ljava/lang/String;Lnet/minecraft/class_3298$class_7367;Lnet/minecraft/class_3298$class_7367;)V
      named <init> Lnet/minecraft/resource/Resource;<init>(Ljava/lang/String;Lnet/minecraft/resource/Resource$InputSupplier;Lnet/minecraft/resource/Resource$InputSupplier;)V
    • Resource

      public Resource(String resourcePackName, Resource.InputSupplier<InputStream> inputSupplier)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lahs;<init>(Ljava/lang/String;Lahs$a;)V
      intermediary <init> Lnet/minecraft/class_3298;<init>(Ljava/lang/String;Lnet/minecraft/class_3298$class_7367;)V
      named <init> Lnet/minecraft/resource/Resource;<init>(Ljava/lang/String;Lnet/minecraft/resource/Resource$InputSupplier;)V
  • Method Details

    • getResourcePackName

      public String getResourcePackName()
      Returns the user-friendly name of the pack this resource is from.
      Mappings:
      Namespace Name Mixin selector
      official a Lahs;a()Ljava/lang/String;
      intermediary method_14480 Lnet/minecraft/class_3298;method_14480()Ljava/lang/String;
      named getResourcePackName Lnet/minecraft/resource/Resource;getResourcePackName()Ljava/lang/String;
    • getInputStream

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

      This input stream is closed when this resource is closed.

      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official b Lahs;b()Ljava/io/InputStream;
      intermediary method_14482 Lnet/minecraft/class_3298;method_14482()Ljava/io/InputStream;
      named getInputStream Lnet/minecraft/resource/Resource;getInputStream()Ljava/io/InputStream;
    • getReader

      public BufferedReader getReader() throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official c Lahs;c()Ljava/io/BufferedReader;
      intermediary method_43039 Lnet/minecraft/class_3298;method_43039()Ljava/io/BufferedReader;
      named getReader Lnet/minecraft/resource/Resource;getReader()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
      official d Lahs;d()Lahw;
      intermediary method_14481 Lnet/minecraft/class_3298;method_14481()Lnet/minecraft/class_7368;
      named getMetadata Lnet/minecraft/resource/Resource;getMetadata()Lnet/minecraft/resource/metadata/ResourceMetadata;