mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +00:00
Workaround for glob() fail, fix worlds not loading properly on some systems, close #197
This commit is contained in:
parent
3672d60bf4
commit
1eaf7c5431
@ -210,6 +210,12 @@ class McRegion extends BaseLevelProvider{
|
|||||||
|
|
||||||
if($isValid){
|
if($isValid){
|
||||||
$files = glob($path . "/region/*.mc*");
|
$files = glob($path . "/region/*.mc*");
|
||||||
|
if(empty($files)){ //possible glob() issue on some systems
|
||||||
|
$files = array_filter(scandir($path . "/region/"), function($file){
|
||||||
|
return substr($file, strrpos($file, ".") + 1, 2) === "mc"; //region file
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
foreach($files as $f){
|
foreach($files as $f){
|
||||||
if(substr($f, strrpos($f, ".") + 1) !== static::REGION_FILE_EXTENSION){
|
if(substr($f, strrpos($f, ".") + 1) !== static::REGION_FILE_EXTENSION){
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user