mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +00:00
Remove ridiculous code in ResourcePackManager
This commit is contained in:
parent
0f0b6f0efa
commit
2dee1dbc28
@ -31,6 +31,9 @@ use function file_exists;
|
|||||||
use function gettype;
|
use function gettype;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
use function is_dir;
|
use function is_dir;
|
||||||
|
use function is_float;
|
||||||
|
use function is_int;
|
||||||
|
use function is_string;
|
||||||
use function mkdir;
|
use function mkdir;
|
||||||
use function strtolower;
|
use function strtolower;
|
||||||
use const DIRECTORY_SEPARATOR;
|
use const DIRECTORY_SEPARATOR;
|
||||||
@ -78,14 +81,12 @@ class ResourcePackManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($resourceStack as $pos => $pack){
|
foreach($resourceStack as $pos => $pack){
|
||||||
try{
|
if(!is_string($pack) && !is_int($pack) && !is_float($pack)){
|
||||||
$pack = (string) $pack;
|
|
||||||
}catch(\ErrorException $e){
|
|
||||||
$logger->critical("Found invalid entry in resource pack list at offset $pos of type " . gettype($pack));
|
$logger->critical("Found invalid entry in resource pack list at offset $pos of type " . gettype($pack));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$pack = (string) $pack;
|
||||||
try{
|
try{
|
||||||
/** @var string $pack */
|
|
||||||
$packPath = $this->path . DIRECTORY_SEPARATOR . $pack;
|
$packPath = $this->path . DIRECTORY_SEPARATOR . $pack;
|
||||||
if(!file_exists($packPath)){
|
if(!file_exists($packPath)){
|
||||||
throw new ResourcePackException("File or directory not found");
|
throw new ResourcePackException("File or directory not found");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user