mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +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:
parent
1f4f8ab3f0
commit
a6d7365a28
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user