crafting: deprecate some stuff that's been removed on bleeding edge

This commit is contained in:
Dylan K. Taylor 2019-06-16 14:11:08 +01:00
parent ac5339414a
commit 4d54dc30c1
5 changed files with 25 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class CraftingManager{
if($recipe["block"] !== "crafting_table"){ //TODO: filter others out for now to avoid breaking economics
break;
}
$this->registerRecipe(new ShapelessRecipe(
$this->registerShapelessRecipe(new ShapelessRecipe(
array_map($itemDeserializerFunc, $recipe["input"]),
array_map($itemDeserializerFunc, $recipe["output"])
));
@ -69,7 +69,7 @@ class CraftingManager{
if($recipe["block"] !== "crafting_table"){ //TODO: filter others out for now to avoid breaking economics
break;
}
$this->registerRecipe(new ShapedRecipe(
$this->registerShapedRecipe(new ShapedRecipe(
$recipe["shape"],
array_map($itemDeserializerFunc, $recipe["input"]),
array_map($itemDeserializerFunc, $recipe["output"])
@ -79,7 +79,7 @@ class CraftingManager{
if($recipe["block"] !== "furnace"){ //TODO: filter others out for now to avoid breaking economics
break;
}
$this->registerRecipe(new FurnaceRecipe(
$this->registerFurnaceRecipe(new FurnaceRecipe(
Item::jsonDeserialize($recipe["output"]),
Item::jsonDeserialize($recipe["input"]))
);
@ -300,6 +300,8 @@ class CraftingManager{
}
/**
* @deprecated
*
* @param Recipe $recipe
*/
public function registerRecipe(Recipe $recipe) : void{

View File

@ -63,6 +63,11 @@ class FurnaceRecipe implements Recipe{
return clone $this->output;
}
/**
* @deprecated
*
* @param CraftingManager $manager
*/
public function registerToCraftingManager(CraftingManager $manager) : void{
$manager->registerFurnaceRecipe($this);
}

View File

@ -25,5 +25,10 @@ namespace pocketmine\inventory;
interface Recipe{
/**
* @deprecated
*
* @param CraftingManager $manager
*/
public function registerToCraftingManager(CraftingManager $manager) : void;
}

View File

@ -187,6 +187,11 @@ class ShapedRecipe implements CraftingRecipe{
return $this->shape;
}
/**
* @deprecated
*
* @param CraftingManager $manager
*/
public function registerToCraftingManager(CraftingManager $manager) : void{
$manager->registerShapedRecipe($this);
}

View File

@ -111,6 +111,11 @@ class ShapelessRecipe implements CraftingRecipe{
return $count;
}
/**
* @deprecated
*
* @param CraftingManager $manager
*/
public function registerToCraftingManager(CraftingManager $manager) : void{
$manager->registerShapelessRecipe($this);
}