Documentation

ResourcePack

Table of Contents

getPackChunk()  : string
Returns a chunk of the resource pack zip as a byte-array for sending to clients.
getPackId()  : string
Returns the pack's UUID as a human-readable string
getPackName()  : string
Returns the human-readable name of the resource pack
getPackSize()  : int
Returns the size of the pack on disk in bytes.
getPackVersion()  : string
Returns a version number for the pack in the format major.minor.patch
getSha256()  : string
Returns the raw SHA256 sum of the compressed resource pack zip. This is used by clients to validate pack downloads.

Methods

getPackChunk()

Returns a chunk of the resource pack zip as a byte-array for sending to clients.

public getPackChunk(int $start, int $length) : string

Note that resource packs must always be in zip archive format for sending. A folder resource loader may need to perform on-the-fly compression for this purpose.

Parameters
$start : int

Offset to start reading the chunk from

$length : int

Maximum length of data to return.

Tags
throws
InvalidArgumentException

if the chunk does not exist

Return values
string

byte-array

getPackId()

Returns the pack's UUID as a human-readable string

public getPackId() : string
Return values
string

getPackName()

Returns the human-readable name of the resource pack

public getPackName() : string
Return values
string

getPackSize()

Returns the size of the pack on disk in bytes.

public getPackSize() : int
Return values
int

getPackVersion()

Returns a version number for the pack in the format major.minor.patch

public getPackVersion() : string
Return values
string

getSha256()

Returns the raw SHA256 sum of the compressed resource pack zip. This is used by clients to validate pack downloads.

public getSha256() : string
Return values
string

byte-array length 32 bytes

Search results