Class ResourcePack

java.lang.Object
de.themoep.resourcepacksplugin.core.ResourcePack

public class ResourcePack extends Object
Created by Phoenix616 on 25.03.2015.
  • Constructor Details

    • ResourcePack

      public ResourcePack(String name, String url, String hash)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
    • ResourcePack

      public ResourcePack(String name, String url, String hash, int format)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      format - The version of this resourcepack as defined in the pack.mcmeta
    • ResourcePack

      public ResourcePack(String name, String url, String hash, boolean restricted)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      restricted - Whether or not this pack should only be send to players with the pluginname.pack.packname permission
    • ResourcePack

      public ResourcePack(String name, String url, String hash, int format, boolean restricted)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      format - The version of this resourcepack as defined in the pack.mcmeta as pack_format
      restricted - Whether or not this pack should only be send to players with the pluginname.pack.packname permission
    • ResourcePack

      public ResourcePack(String name, String url, String hash, int format, boolean restricted, String permission)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      format - The version of this resourcepack as defined in the pack.mcmeta as pack_format
      permission - A custom permission for this pack
      restricted - Whether or not this pack should only be send to players with the pluginname.pack.packname permission
    • ResourcePack

      public ResourcePack(String name, String url, String hash, int format, int version, boolean restricted, String permission)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      format - The version of this resourcepack as defined in the pack.mcmeta as pack_format
      version - The Minecraft version that this resourcepack is for
      permission - A custom permission for this pack
      restricted - Whether or not this pack should only be send to players with the pluginname.pack.packname permission
    • ResourcePack

      public ResourcePack(String name, String url, String hash, int format, int version, boolean restricted, String permission, ClientType type)
      Object representation of a resourcepack set in the plugin's config file.
      Parameters:
      name - The name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      url - The url where this resourcepack is located at and where the client will download it from
      hash - The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      format - The version of this resourcepack as defined in the pack.mcmeta as pack_format
      version - The Minecraft version that this resourcepack is for
      permission - A custom permission for this pack
      restricted - Whether or not this pack should only be send to players with the pluginname.pack.packname permission
      type - The type of the pack depending on the client which should receive it
  • Method Details

    • getName

      public String getName()
      Get the name of the resourcepack as set in the config. Serves as an uinque identifier. Correct case.
      Returns:
      The name as a string in correct case
    • getUrl

      public String getUrl()
      Get the url where this resourcepack is located at and where the client will download it from
      Returns:
      The url as a string
    • getHash

      public String getHash()
      Get the hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
      Returns:
      The 40 digit lowercase hash
    • getRawHash

      public byte[] getRawHash()
    • setRawHash

      public void setRawHash(byte[] hash)
    • getFormat

      public int getFormat()
      Get the pack format version
      Returns:
      The pack version as an int
    • setFormat

      public boolean setFormat(int format)
      Set the pack format version
      Parameters:
      format - The pack version as an int
      Returns:
      Whether or not the format changed
    • getVersion

      public int getVersion()
      Get the pack Minecraft protocol version
      Returns:
      The Minecraft protocol version as an int
    • setVersion

      public boolean setVersion(int version)
      Set the pack Minecraft protocol version
      Parameters:
      version - The Minecraft protocol version as an int
    • isRestricted

      public boolean isRestricted()
      Whether or not this pack is restricted and a permission should be used
      Returns:
      true if one needs the permission, false if not
    • setRestricted

      public boolean setRestricted(boolean restricted)
      Whether or not this pack is restricted and a permission should be used
      Parameters:
      restricted - true if one needs the permission, false if not
      Returns:
      Whether or not the restricted status changed
    • getPermission

      public String getPermission()
      Get the permission to use this pack
      Returns:
      The permission as a string
    • setPermission

      public boolean setPermission(String permission)
      Set the permission to use this pack
      Parameters:
      permission - The permission as a string
      Returns:
      Whether or not the permission changed
    • getType

      public ClientType getType()
      Get the client type that the resource pack is for
      Returns:
      The type
    • setType

      public boolean setType(ClientType type)
      Set the client type that the resource pack is for
      Parameters:
      type - The type
      Returns:
    • getVariants

      public List<ResourcePack> getVariants()
      Get a list of different pack variants. Used to get, add and remove variants.
      Returns:
      The list of pack variants
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getReplacements

      public String[] getReplacements()
    • serialize

      public Map<String,​Object> serialize()