PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\resourcepacks\ResourcePackManager Class Reference
+ Collaboration diagram for pocketmine\resourcepacks\ResourcePackManager:

Public Member Functions

 __construct (string $path, \Logger $logger)
 
 getPackById (string $id)
 
 getPackEncryptionKey (string $id)
 
 getPackIdList ()
 
 getPath ()
 
 getResourceStack ()
 
 resourcePacksRequired ()
 
 setPackEncryptionKey (string $id, ?string $key)
 
 setResourcePacksRequired (bool $value)
 
 setResourceStack (array $resourceStack)
 

Detailed Description

Definition at line 45 of file ResourcePackManager.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\resourcepacks\ResourcePackManager::__construct ( string  $path,
\Logger  $logger 
)
Parameters
string$pathPath to resource-packs directory.

Definition at line 64 of file ResourcePackManager.php.

References Logger\critical(), Logger\debug(), pocketmine\utils\Filesystem\fileGetContents(), and Logger\info().

+ Here is the call graph for this function:

Member Function Documentation

◆ getPackById()

pocketmine\resourcepacks\ResourcePackManager::getPackById ( string  $id)

Returns the resource pack matching the specified UUID string, or null if the ID was not recognized.

Definition at line 198 of file ResourcePackManager.php.

◆ getPackEncryptionKey()

pocketmine\resourcepacks\ResourcePackManager::getPackEncryptionKey ( string  $id)

Returns the key with which the pack was encrypted, or null if the pack has no key.

Definition at line 213 of file ResourcePackManager.php.

◆ getPackIdList()

pocketmine\resourcepacks\ResourcePackManager::getPackIdList ( )

Returns an array of pack IDs for packs currently in use.

Returns
string[]

Definition at line 206 of file ResourcePackManager.php.

◆ getPath()

pocketmine\resourcepacks\ResourcePackManager::getPath ( )

Returns the directory which resource packs are loaded from.

Definition at line 146 of file ResourcePackManager.php.

◆ getResourceStack()

pocketmine\resourcepacks\ResourcePackManager::getResourceStack ( )

Returns an array of resource packs in use, sorted in order of priority.

Returns
ResourcePack[]

Definition at line 168 of file ResourcePackManager.php.

◆ resourcePacksRequired()

pocketmine\resourcepacks\ResourcePackManager::resourcePacksRequired ( )

Returns whether players must accept resource packs in order to join.

Definition at line 153 of file ResourcePackManager.php.

◆ setPackEncryptionKey()

pocketmine\resourcepacks\ResourcePackManager::setPackEncryptionKey ( string  $id,
?string  $key 
)

Sets the encryption key to use for decrypting the specified resource pack. The pack will NOT be decrypted by PocketMine-MP; the key is simply passed to the client to allow it to decrypt the pack after downloading it.

Definition at line 221 of file ResourcePackManager.php.

◆ setResourcePacksRequired()

pocketmine\resourcepacks\ResourcePackManager::setResourcePacksRequired ( bool  $value)

Sets whether players must accept resource packs in order to join.

Definition at line 160 of file ResourcePackManager.php.

◆ setResourceStack()

pocketmine\resourcepacks\ResourcePackManager::setResourceStack ( array  $resourceStack)

Sets the resource packs to use. Packs earliest in the list will appear at the top of the stack (maximum priority), and later ones will appear below (lower priority), in the same manner as the Bedrock resource packs screen in-game.

Parameters
ResourcePack[]$resourceStack@phpstan-param list<ResourcePack> $resourceStack

Definition at line 180 of file ResourcePackManager.php.


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