PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\resourcepacks\ZippedResourcePack Class Reference
+ Inheritance diagram for pocketmine\resourcepacks\ZippedResourcePack:
+ Collaboration diagram for pocketmine\resourcepacks\ZippedResourcePack:

Public Member Functions

 __construct (string $zipPath)
 
 getPackChunk (int $start, int $length)
 
 getPackId ()
 
 getPackName ()
 
 getPackSize ()
 
 getPackVersion ()
 
 getPath ()
 
 getSha256 ()
 
 getSha256 (bool $cached=true)
 

Protected Attributes

 $fileResource
 
Manifest $manifest
 
string $path
 
string $sha256 = null
 

Detailed Description

Definition at line 43 of file ZippedResourcePack.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\resourcepacks\ZippedResourcePack::__construct ( string $zipPath)
Parameters
string$zipPathPath to the resource pack zip
Exceptions
ResourcePackException

Definition at line 55 of file ZippedResourcePack.php.

◆ __destruct()

pocketmine\resourcepacks\ZippedResourcePack::__destruct ( )

Definition at line 125 of file ZippedResourcePack.php.

Member Function Documentation

◆ getPackChunk()

pocketmine\resourcepacks\ZippedResourcePack::getPackChunk ( int $start,
int $length )

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

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
int$startOffset to start reading the chunk from
int$lengthMaximum length of data to return.

@phpstan-param positive-int $length

Returns
string byte-array
Exceptions

InvalidArgumentException if the chunk does not exist

Implements pocketmine\resourcepacks\ResourcePack.

Definition at line 156 of file ZippedResourcePack.php.

◆ getPackId()

pocketmine\resourcepacks\ZippedResourcePack::getPackId ( )

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

Implements pocketmine\resourcepacks\ResourcePack.

Definition at line 141 of file ZippedResourcePack.php.

◆ getPackName()

pocketmine\resourcepacks\ZippedResourcePack::getPackName ( )

Returns the human-readable name of the resource pack

Implements pocketmine\resourcepacks\ResourcePack.

Definition at line 133 of file ZippedResourcePack.php.

◆ getPackSize()

pocketmine\resourcepacks\ZippedResourcePack::getPackSize ( )

Returns the size of the pack on disk in bytes.

Implements pocketmine\resourcepacks\ResourcePack.

Definition at line 145 of file ZippedResourcePack.php.

◆ getPackVersion()

pocketmine\resourcepacks\ZippedResourcePack::getPackVersion ( )

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

Implements pocketmine\resourcepacks\ResourcePack.

Definition at line 137 of file ZippedResourcePack.php.

◆ getPath()

pocketmine\resourcepacks\ZippedResourcePack::getPath ( )

Definition at line 129 of file ZippedResourcePack.php.

◆ getSha256() [1/2]

pocketmine\resourcepacks\ResourcePack::getSha256 ( )
inherited

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

Returns
string byte-array length 32 bytes

◆ getSha256() [2/2]

pocketmine\resourcepacks\ZippedResourcePack::getSha256 ( bool $cached = true)

Definition at line 149 of file ZippedResourcePack.php.

Member Data Documentation

◆ $fileResource

pocketmine\resourcepacks\ZippedResourcePack::$fileResource
protected

Definition at line 49 of file ZippedResourcePack.php.

◆ $manifest

Manifest pocketmine\resourcepacks\ZippedResourcePack::$manifest
protected

Definition at line 45 of file ZippedResourcePack.php.

◆ $path

string pocketmine\resourcepacks\ZippedResourcePack::$path
protected

Definition at line 44 of file ZippedResourcePack.php.

◆ $sha256

string pocketmine\resourcepacks\ZippedResourcePack::$sha256 = null
protected

Definition at line 46 of file ZippedResourcePack.php.


The documentation for this class was generated from the following file: