For example, I want to make a Folder named "Diamond", and create Stone.yaml inside Diamond Folder(with mkdir) How can?
PHP: if(!is_dir($this->getDataFolder() . "blocks")) { mkdir($this->getDataFolder() . "blocks"); // Getting the data folder } $this->saveConfig(); $this->saveResource("blocks" . DIRECTORY_SEPARATOR . "stone.yml");
Then How can I create "Item" Folder before creating "blocks"? and if "Item" Folder is already created, How can I create "blocks" folder inside "Item" folder. like Item\blocks\stone.yml
PHP: if(!is_dir($this->getDataFolder() . "Item")) { mkdir($this->getDataFolder() . "Item");}if(!is_dir($this->getDataFolder() . "Blocks")) { mkdir($this->getDataFolder() . DIRECTORY_SEPARATOR."Item".DIRECTORY_SEPARATOR"Blocks");}$this->saveConfig();$this->saveResource("Item" . DIRECTORY_SEPARATOR ."Blocks".DIRECTORY_SEPARATOR . "stone.yml");