mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Moved CraftingManager init to its own function
this allows the crafting manager to be re-initialized on the fly without recreating it.
This commit is contained in:
@ -30,7 +30,6 @@ use pocketmine\network\mcpe\protocol\CraftingDataPacket;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\utils\Config;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\UUID;
|
||||
|
||||
class CraftingManager{
|
||||
@ -51,9 +50,12 @@ class CraftingManager{
|
||||
private $craftingDataCache;
|
||||
|
||||
public function __construct(){
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init() : void{
|
||||
$recipes = new Config(\pocketmine\RESOURCE_PATH . "recipes.json", Config::JSON, []);
|
||||
|
||||
MainLogger::getLogger()->info("Loading recipes...");
|
||||
foreach($recipes->getAll() as $recipe){
|
||||
switch($recipe["type"]){
|
||||
case 0:
|
||||
|
Reference in New Issue
Block a user