mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
ResourcePackManager: avoid repeated operation
This commit is contained in:
parent
bda0ca23b4
commit
d6bbf8217d
@ -113,12 +113,13 @@ class ResourcePackManager{
|
||||
|
||||
if($newPack instanceof ResourcePack){
|
||||
$this->resourcePacks[] = $newPack;
|
||||
$this->uuidList[strtolower($newPack->getPackId())] = $newPack;
|
||||
$index = strtolower($newPack->getPackId());
|
||||
$this->uuidList[$index] = $newPack;
|
||||
|
||||
$keyPath = Path::join($this->path, $pack . ".key");
|
||||
if(file_exists($keyPath)){
|
||||
try{
|
||||
$this->encryptionKeys[strtolower($newPack->getPackId())] = ErrorToExceptionHandler::trapAndRemoveFalse(
|
||||
$this->encryptionKeys[$index] = ErrorToExceptionHandler::trapAndRemoveFalse(
|
||||
fn() => file_get_contents($keyPath)
|
||||
);
|
||||
}catch(\ErrorException $e){
|
||||
|
Loading…
x
Reference in New Issue
Block a user