mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Merge branch 'next-minor'
# Conflicts: # resources/vanilla # src/plugin/PluginBase.php # src/plugin/PluginDescription.php # src/pocketmine/Player.php # src/pocketmine/network/rcon/RCON.php # src/pocketmine/network/rcon/RCONInstance.php # src/pocketmine/scheduler/AsyncTask.php # src/pocketmine/tile/Spawnable.php # src/scheduler/AsyncPool.php # src/utils/Config.php # src/utils/Timezone.php # src/utils/UUID.php # src/utils/Utils.php # src/world/format/io/region/RegionLoader.php
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\plugin;
|
||||
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use function file_exists;
|
||||
use function fopen;
|
||||
use function is_dir;
|
||||
@ -53,8 +54,10 @@ class DiskResourceProvider implements ResourceProvider{
|
||||
*/
|
||||
public function getResource(string $filename){
|
||||
$filename = rtrim(str_replace("\\", "/", $filename), "/");
|
||||
if(file_exists($this->file . "/" . $filename)){
|
||||
return fopen($this->file . "/" . $filename, "rb");
|
||||
if(file_exists($this->file . "resources/" . $filename)){
|
||||
$resource = fopen($this->file . "resources/" . $filename, "rb");
|
||||
if($resource === false) throw new AssumptionFailedError("fopen() should not fail on a file which exists");
|
||||
return $resource;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user