Start using webmozart/pathutil for joining paths (#4287)

This commit is contained in:
Dylan T
2021-06-29 19:40:43 +01:00
committed by GitHub
parent aee7b03c1d
commit 32d7b1e6af
31 changed files with 252 additions and 172 deletions

View File

@ -26,9 +26,9 @@ namespace pocketmine\inventory;
use pocketmine\item\Durable;
use pocketmine\item\Item;
use pocketmine\utils\SingletonTrait;
use Webmozart\PathUtil\Path;
use function file_get_contents;
use function json_decode;
use const DIRECTORY_SEPARATOR;
final class CreativeInventory{
use SingletonTrait;
@ -37,7 +37,7 @@ final class CreativeInventory{
private $creative = [];
private function __construct(){
$creativeItems = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "creativeitems.json"), true);
$creativeItems = json_decode(file_get_contents(Path::join(\pocketmine\RESOURCE_PATH, "vanilla", "creativeitems.json")), true);
foreach($creativeItems as $data){
$item = Item::jsonDeserialize($data);