mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Don't use Config for builtin JSON resources
it doesn't make sense to use a config in these cases, and also it just hides problems when the files are missing.
This commit is contained in:
@ -29,7 +29,6 @@ use pocketmine\network\mcpe\protocol\BatchPacket;
|
||||
use pocketmine\network\mcpe\protocol\CraftingDataPacket;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\utils\Config;
|
||||
|
||||
class CraftingManager{
|
||||
/** @var ShapedRecipe[][] */
|
||||
@ -47,9 +46,9 @@ class CraftingManager{
|
||||
}
|
||||
|
||||
public function init() : void{
|
||||
$recipes = new Config(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "recipes.json", Config::JSON, []);
|
||||
$recipes = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "recipes.json"), true);
|
||||
|
||||
foreach($recipes->getAll() as $recipe){
|
||||
foreach($recipes as $recipe){
|
||||
switch($recipe["type"]){
|
||||
case 0:
|
||||
$this->registerRecipe(new ShapelessRecipe(
|
||||
|
Reference in New Issue
Block a user