Class ResourceUtils

java.lang.Object
codechicken.lib.util.ResourceUtils

public class ResourceUtils extends Object
Created by covers1624 on 11/07/2017.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.server.packs.resources.Resource
    getResource(net.minecraft.resources.Identifier location)
    Get's an IResource from the resource manager.
    getResourceAsStream(net.minecraft.resources.Identifier resource)
    Retrieves an InputStream from the standard Vanilla IReloadableResourceManager.
    static net.minecraft.server.packs.resources.ResourceManager
    Grabs the resource manager.
    static List<String>
    loadResource(net.minecraft.server.packs.resources.ResourceProvider resourceProvider, net.minecraft.resources.Identifier loc)
    Loads the given Identifier with the given ResourceProvider into a list of UTF-8 Strings.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResourceUtils

      public ResourceUtils()
  • Method Details

    • getResourceAsStream

      public static InputStream getResourceAsStream(net.minecraft.resources.Identifier resource) throws IOException
      Retrieves an InputStream from the standard Vanilla IReloadableResourceManager.
      Parameters:
      resource - The resource.
      Returns:
      The InputStream.
      Throws:
      IOException - If the file is not found or some other IO error occurred.
    • getResourceManager

      public static net.minecraft.server.packs.resources.ResourceManager getResourceManager()
      Grabs the resource manager.
      Returns:
      The resource manager.
    • getResource

      public static net.minecraft.server.packs.resources.Resource getResource(net.minecraft.resources.Identifier location) throws IOException
      Get's an IResource from the resource manager.
      Parameters:
      location - The resource to get.
      Returns:
      The gotten resource.
      Throws:
      IOException - If the resource doesn't exist, or some other IO error occurred.
    • loadResource

      public static List<String> loadResource(net.minecraft.server.packs.resources.ResourceProvider resourceProvider, net.minecraft.resources.Identifier loc)
      Loads the given Identifier with the given ResourceProvider into a list of UTF-8 Strings.
      Parameters:
      resourceProvider - The ResourceProvider.
      loc - The Identifier.
      Returns:
      The UTF-8 lines of the resource.