Documentation

ZippedResourcePack
in package
implements ResourcePack

Interfaces, Classes, Traits and Enums

ResourcePack

Table of Contents

$fileResource  : resource
$manifest  : Manifest
$path  : string
$sha256  : string|null
__construct()  : mixed
__destruct()  : mixed
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
getPath()  : string
getSha256()  : string
Returns the raw SHA256 sum of the compressed resource pack zip. This is used by clients to validate pack downloads.

Properties

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.

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([bool $cached = true ]) : string
Parameters
$cached : bool = true
Return values
string

byte-array length 32 bytes

Search results