mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Start using webmozart/pathutil for joining paths (#4287)
This commit is contained in:
@@ -25,6 +25,7 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\SingletonTrait;
|
||||
use Webmozart\PathUtil\Path;
|
||||
use function explode;
|
||||
use function file_get_contents;
|
||||
use function is_array;
|
||||
@@ -51,7 +52,7 @@ final class LegacyStringToItemParser{
|
||||
private static function make() : self{
|
||||
$result = new self(ItemFactory::getInstance());
|
||||
|
||||
$mappingsRaw = @file_get_contents(\pocketmine\RESOURCE_PATH . '/item_from_string_bc_map.json');
|
||||
$mappingsRaw = @file_get_contents(Path::join(\pocketmine\RESOURCE_PATH, 'item_from_string_bc_map.json'));
|
||||
if($mappingsRaw === false) throw new AssumptionFailedError("Missing required resource file");
|
||||
|
||||
$mappings = json_decode($mappingsRaw, true);
|
||||
|
Reference in New Issue
Block a user