Interface ResourcePackInfo


public interface ResourcePackInfo
  • Method Details

    • getUrl

      String getUrl()
      Gets the link the resource-pack can be found at.
      Returns:
      the location of the resource-pack
    • getPrompt

      @Nullable Component getPrompt()
      Gets the Component that is displayed on the resource-pack prompt. This is only displayed if the client version is 1.17 or newer.
      Returns:
      the prompt if present or null otherwise
    • getShouldForce

      boolean getShouldForce()
      Gets whether or not the acceptance of the resource-pack is enforced. See ResourcePackInfo.Builder.setShouldForce(boolean) for more information.
      Returns:
      whether or not to force usage of this resource-pack
    • getHash

      @org.checkerframework.checker.nullness.qual.Nullable byte[] getHash()
      Gets the SHA-1 hash of the resource-pack See ResourcePackInfo.Builder.setHash(byte[]) for more information.
      Returns:
      the hash if present or null otherwise
    • getOrigin

      Gets the ResourcePackInfo.Origin of this resource-pack.
      Returns:
      the origin of the resource pack
    • getOriginalOrigin

      ResourcePackInfo.Origin getOriginalOrigin()
      Gets the original ResourcePackInfo.Origin of the resource-pack. The original origin may differ if the resource pack was altered in the event ServerResourcePackSendEvent.
      Returns:
      the origin of the resource pack
    • asBuilder

      Returns a copy of this ResourcePackInfo instance as a builder so that it can be modified. It is not guaranteed that resourcePackInfo.asBuilder().build().equals(resourcePackInfo) is true. That is due to the transient getOrigin() and getOriginalOrigin() fields.
      Returns:
      a content-copy of this instance as a ResourcePackInfo.Builder
    • asBuilder

      ResourcePackInfo.Builder asBuilder(String newUrl)
      Returns a copy of this ResourcePackInfo instance as a builder with the new URL as the pack URL so that it can be modified. It is not guaranteed that resourcePackInfo.asBuilder(resourcePackInfo.getUrl()).build().equals(resourcePackInfo) is true. That is due to the transient getOrigin() and getOriginalOrigin() fields.
      Parameters:
      newUrl - The new URL to use in the updated builder.
      Returns:
      a content-copy of this instance as a ResourcePackInfo.Builder