PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\resourcepacks\ResourcePack Interface Reference
+ Inheritance diagram for pocketmine\resourcepacks\ResourcePack:
+ Collaboration diagram for pocketmine\resourcepacks\ResourcePack:

Public Member Functions

 getPackChunk (int $start, int $length)
 
 getPackId ()
 
 getPackName ()
 
 getPackSize ()
 
 getPackVersion ()
 
 getSha256 ()
 

Detailed Description

Definition at line 26 of file ResourcePack.php.

Member Function Documentation

◆ getPackChunk()

pocketmine\resourcepacks\ResourcePack::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

Implemented in pocketmine\resourcepacks\ZippedResourcePack.

◆ getPackId()

pocketmine\resourcepacks\ResourcePack::getPackId ( )

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

Implemented in pocketmine\resourcepacks\ZippedResourcePack.

Referenced by pocketmine\event\player\PlayerResourcePackOfferEvent\addResourcePack().

+ Here is the caller graph for this function:

◆ getPackName()

pocketmine\resourcepacks\ResourcePack::getPackName ( )

Returns the human-readable name of the resource pack

Implemented in pocketmine\resourcepacks\ZippedResourcePack.

◆ getPackSize()

pocketmine\resourcepacks\ResourcePack::getPackSize ( )

Returns the size of the pack on disk in bytes.

Implemented in pocketmine\resourcepacks\ZippedResourcePack.

◆ getPackVersion()

pocketmine\resourcepacks\ResourcePack::getPackVersion ( )

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

Implemented in pocketmine\resourcepacks\ZippedResourcePack.

◆ getSha256()

pocketmine\resourcepacks\ResourcePack::getSha256 ( )

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

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