Interface ResourcePack


public interface ResourcePack
Represents a resource pack that can be sent to the client.
  • Method Details

    • fromUri

      static ResourcePack fromUri(URI uri) throws FileNotFoundException
      Creates a ResourcePack from a URI and tries to download and hash it.
      Parameters:
      uri - The URI to look in
      Returns:
      A ResourcePack with the specified URI
      Throws:
      FileNotFoundException - If a valid resource pack could not be downloaded from the URI
    • fromUriUnchecked

      static ResourcePack fromUriUnchecked(URI uri)
      Creates a ResourcePack from a URI, without checking ("unchecked") if there is a valid pack at the URI.
      Parameters:
      uri - The URI to look in
      Returns:
      A ResourcePack with the specified URI
    • uri

      URI uri()
      Gets the URI associated with this resource pack.
      Returns:
      The URI associated with this resource pack.
    • name

      String name()
      Gets the name of this resource pack. This is the filename of the pack zip file, with all non-word characters removed. Note to implementers: The name MUST be calculated like above, or this API will not work.
      Returns:
      The name of this resource pack. This is the filename of the pack .zip, with all non-word characters removed
    • id

      String id()
      Gets the ID of this resource pack.
      Returns:
      the ID of this resource pack
    • prompt

      Component prompt()
      Gets the prompt of this resource pack.
      Returns:
      the prompt of this resource pack
    • hash

      Optional<String> hash()
      Gets the hash of this resource pack.
      Returns:
      The hash of this pack, if present