Class ResourcePack
java.lang.Object
de.themoep.resourcepacksplugin.core.ResourcePack
Created by Phoenix616 on 25.03.2015.
-
Constructor Summary
ConstructorDescriptionResourcePack
(String name, String url, String hash) Object representation of a resourcepack set in the plugin's config file.ResourcePack
(String name, String url, String hash, boolean restricted) Object representation of a resourcepack set in the plugin's config file.ResourcePack
(String name, String url, String hash, int format) Object representation of a resourcepack set in the plugin's config file.ResourcePack
(String name, String url, String hash, int format, boolean restricted) Object representation of a resourcepack set in the plugin's config file.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.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.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.ResourcePack
(String name, String url, String hash, String localPath, int format, int version, boolean restricted, String permission, ClientType type) Object representation of a resourcepack set in the plugin's config file.ResourcePack
(String name, UUID uuid, String url, String hash) Object representation of a resourcepack set in the plugin's config file.ResourcePack
(String name, UUID uuid, String url, String hash, String localPath, int format, int version, boolean restricted, String permission, ClientType type) Object representation of a resourcepack set in the plugin's config file. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Get the pack format versiongetHash()
Get the hash set for this resourcepack.Get the local path where this resourcepack is located at on your file systemgetName()
Get the name of the resourcepack as set in the config.Get the permission to use this packbyte[]
String[]
getType()
Get the client type that the resource pack is forgetUrl()
Get the url where this resourcepack is located at and where the client will download it fromgetUuid()
Get the universally unique identifier (UUID) associated with the resource pack.Get a list of different pack variants.int
Get the pack Minecraft protocol versionint
hashCode()
boolean
Whether or not this pack is restricted and a permission should be usedboolean
setFormat
(int format) Set the pack format versionboolean
setPermission
(String permission) Set the permission to use this packvoid
setRawHash
(byte[] hash) boolean
setRestricted
(boolean restricted) Whether or not this pack is restricted and a permission should be usedboolean
setType
(ClientType type) Set the client type that the resource pack is forvoid
Set the universally unique identifier (UUID) associated with the resource pack.boolean
setVersion
(int version) Set the pack Minecraft protocol versionboolean
setVersion
(String versionString) Utility method to set the pack Minecraft version from a string
-
Constructor Details
-
ResourcePack
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 unique identifier. Correct case.url
- The url where this resourcepack is located at and where the client will download it fromhash
- The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
-
ResourcePack
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 unique identifier. Correct case.uuid
- The uuid of the resourcepack as set in the config.url
- The url where this resourcepack is located at and where the client will download it fromhash
- The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.
-
ResourcePack
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 unique identifier. Correct case.url
- The url where this resourcepack is located at and where the client will download it fromhash
- 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
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 unique identifier. Correct case.url
- The url where this resourcepack is located at and where the client will download it fromhash
- 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
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 unique identifier. Correct case.url
- The url where this resourcepack is located at and where the client will download it fromhash
- 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_formatrestricted
- 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 fromhash
- 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_formatpermission
- A custom permission for this packrestricted
- 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 fromhash
- 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_formatversion
- The Minecraft version that this resourcepack is forpermission
- A custom permission for this packrestricted
- 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 fromhash
- 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_formatversion
- The Minecraft version that this resourcepack is forpermission
- A custom permission for this packrestricted
- Whether or not this pack should only be send to players with the pluginname.pack.packname permissiontype
- The type of the pack depending on the client which should receive it
-
ResourcePack
public ResourcePack(String name, String url, String hash, String localPath, 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 unique identifier. Correct case.url
- The url where this resourcepack is located at and where the client will download it fromhash
- The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.localPath
- The local path to this resourcepack. Ideally this points to the same file as the url points to.format
- The version of this resourcepack as defined in the pack.mcmeta as pack_formatversion
- The Minecraft version that this resourcepack is forpermission
- A custom permission for this packrestricted
- Whether or not this pack should only be send to players with the pluginname.pack.packname permissiontype
- The type of the pack depending on the client which should receive it
-
ResourcePack
public ResourcePack(String name, UUID uuid, String url, String hash, String localPath, 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 unique identifier. Correct case.uuid
- The uuid of the resourcepack as set in the config.url
- The url where this resourcepack is located at and where the client will download it fromhash
- The hash set for this resourcepack. Ideally this is the zip file's sha1 hash.localPath
- The local path to this resourcepack. Ideally this points to the same file as the url points to.format
- The version of this resourcepack as defined in the pack.mcmeta as pack_formatversion
- The Minecraft version that this resourcepack is forpermission
- A custom permission for this packrestricted
- Whether or not this pack should only be send to players with the pluginname.pack.packname permissiontype
- The type of the pack depending on the client which should receive it
-
-
Method Details
-
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
-
getUuid
Get the universally unique identifier (UUID) associated with the resource pack.- Returns:
- The UUID as an instance of the UUID class.
-
setUuid
Set the universally unique identifier (UUID) associated with the resource pack.- Parameters:
uuid
- The UUID of the resource pack.
-
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
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) -
getLocalPath
Get the local path where this resourcepack is located at on your file system- Returns:
- The path as a string
-
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
-
setVersion
Utility method to set the pack Minecraft version from a string- Parameters:
versionString
- The Minecraft version as string descriptor- Throws:
IllegalArgumentException
- Thrown when the string is not valid
-
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
Get the permission to use this pack- Returns:
- The permission as a string
-
setPermission
Set the permission to use this pack- Parameters:
permission
- The permission as a string- Returns:
- Whether or not the permission changed
-
getType
Get the client type that the resource pack is for- Returns:
- The type
-
setType
Set the client type that the resource pack is for- Parameters:
type
- The type- Returns:
- Whether or not the ClientType changed
-
getVariants
Get a list of different pack variants. Used to get, add and remove variants.- Returns:
- The list of pack variants
-
equals
-
hashCode
public int hashCode() -
getReplacements
-
serialize
-