|
|
|
@ -21,8 +21,15 @@
|
|
|
|
|
|
|
|
|
|
namespace pocketmine\inventory;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use pocketmine\block\Planks;
|
|
|
|
|
use pocketmine\block\Quartz;
|
|
|
|
|
use pocketmine\block\Sandstone;
|
|
|
|
|
use pocketmine\block\Slab;
|
|
|
|
|
use pocketmine\block\Fence;
|
|
|
|
|
use pocketmine\block\Stone;
|
|
|
|
|
use pocketmine\block\StoneBricks;
|
|
|
|
|
use pocketmine\block\StoneWall;
|
|
|
|
|
use pocketmine\block\Wood;
|
|
|
|
|
use pocketmine\block\Wood2;
|
|
|
|
|
use pocketmine\item\Item;
|
|
|
|
@ -110,56 +117,251 @@ class CraftingManager{
|
|
|
|
|
"XX"
|
|
|
|
|
))->setIngredient("X", Item::get(Item::STRING, 0, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new ShapelessRecipe(Item::get(Item::TORCH, 0, 4)))->addIngredient(Item::get(Item::COAL, 0, 1))->addIngredient(Item::get(Item::STICK, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new ShapelessRecipe(Item::get(Item::TORCH, 0, 4)))->addIngredient(Item::get(Item::COAL, 1, 1))->addIngredient(Item::get(Item::STICK, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new ShapelessRecipe(Item::get(Item::SUGAR, 0, 1)))->addIngredient(Item::get(Item::SUGARCANE, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new ShapedRecipe(Item::get(Item::TORCH, 0, 4),
|
|
|
|
|
"C ",
|
|
|
|
|
"S"
|
|
|
|
|
))->setIngredient("C", Item::get(Item::COAL,0,1))->setIngredient("S", Item::get(Item::STICK,0,1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new ShapedRecipe(Item::get(Item::TORCH, 0, 4),
|
|
|
|
|
"C ",
|
|
|
|
|
"S"
|
|
|
|
|
))->setIngredient("C", Item::get(Item::COAL, 1, 1))->setIngredient("S", Item::get(Item::STICK, 0, 1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BED, 0, 1)))->addIngredient(Item::get(Item::WOOL, null, 3))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::CHEST, 0, 1)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 8)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::OAK, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, Planks::SPRUCE, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, Planks::BIRCH, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, Planks::JUNGLE, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, Planks::ACACIA, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, Planks::DARK_OAK, 3)))->addIngredient(Item::get(Item::STICK, 0, 2))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::OAK, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE_SPRUCE, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE_BIRCH, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE_JUNGLE, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE_DARK_OAK, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE_ACACIA, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 2)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FURNACE, 0, 1)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 8)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::GLASS_PANE, 0, 16)))->addIngredient(Item::get(Item::GLASS, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::LADDER, 0, 2)))->addIngredient(Item::get(Item::STICK, 0, 7)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::NETHER_REACTOR, 0, 1)))->addIngredient(Item::get(Item::DIAMOND, 0, 3))->addIngredient(Item::get(Item::IRON_INGOT, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::TRAPDOOR, 0, 2)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOODEN_DOOR, 0, 1)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOODEN_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::OAK, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::OAK, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::OAK, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::SPRUCE_WOOD_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::SPRUCE, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BIRCH_WOOD_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::BIRCH, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::JUNGLE_WOOD_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::JUNGLE, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::ACACIA_WOOD_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::ACACIA, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::DARK_OAK_WOOD_STAIRS, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::WOOD_SLAB, Planks::DARK_OAK, 6)))->addIngredient(Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 3)));
|
|
|
|
|
$this->registerRecipe((new ShapedRecipe(Item::get(Item::SUGAR, 0, 1),
|
|
|
|
|
"S"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::SUGARCANE, 0, 1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BUCKET, 0, 1)))->addIngredient(Item::get(Item::IRON_INGOT, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::CLOCK, 0, 1)))->addIngredient(Item::get(Item::GOLD_INGOT, 0, 4))->addIngredient(Item::get(Item::REDSTONE_DUST, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::COMPASS, 0, 1)))->addIngredient(Item::get(Item::IRON_INGOT, 0, 4))->addIngredient(Item::get(Item::REDSTONE_DUST, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::TNT, 0, 1)))->addIngredient(Item::get(Item::GUNPOWDER, 0, 5))->addIngredient(Item::get(Item::SAND, null, 4)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BOWL, 0, 4)))->addIngredient(Item::get(Item::WOODEN_PLANKS, null, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::MINECART, 0, 1)))->addIngredient(Item::get(Item::IRON_INGOT, 0, 5)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BOOK, 0, 1)))->addIngredient(Item::get(Item::PAPER, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BOOKSHELF, 0, 1)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 6))->addIngredient(Item::get(Item::BOOK, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::PAINTING, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 8))->addIngredient(Item::get(Item::WOOL, null, 1)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::PAPER, 0, 1)))->addIngredient(Item::get(Item::SUGARCANE, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::SIGN, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 1))->addIngredient(Item::get(Item::WOODEN_PLANKS, null, 6))); //TODO: check if it gives one sign or three
|
|
|
|
|
$this->registerRecipe((new BigShapelessRecipe(Item::get(Item::IRON_BARS, 0, 16)))->addIngredient(Item::get(Item::IRON_INGOT, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BED, 0, 1),
|
|
|
|
|
"WWW",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("W", Item::get(Item::WOOL, null, 3))->setIngredient("P", Item::get(Item::WOODEN_PLANK, null, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::CHEST, 0, 1),
|
|
|
|
|
"PPP",
|
|
|
|
|
"P P",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, null, 8)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, 0, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::OAK, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, Planks::SPRUCE, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, Planks::BIRCH, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, Planks::JUNGLE, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, Planks::ACACIA, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE, Planks::DARK_OAK, 3),
|
|
|
|
|
"PSP",
|
|
|
|
|
"PSP"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 2))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::OAK, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE_SPRUCE, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE_BIRCH, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE_JUNGLE, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE_DARK_OAK, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FENCE_GATE_ACACIA, 0, 1),
|
|
|
|
|
"SPS",
|
|
|
|
|
"SPS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 4))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 2)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::FURNACE, 0, 1),
|
|
|
|
|
"CCC",
|
|
|
|
|
"C C",
|
|
|
|
|
"CCC"
|
|
|
|
|
))->setIngredient("C", Item::get(Item::COBBLESTONE, 0, 8)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::GLASS_PANE, 0, 16),
|
|
|
|
|
"GGG",
|
|
|
|
|
"GGG"
|
|
|
|
|
))->setIngredient("G", Item::get(Item::GLASS, 0, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::LADDER, 0, 2),
|
|
|
|
|
"S S",
|
|
|
|
|
"SSS",
|
|
|
|
|
"S S"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 7)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::NETHER_REACTOR, 0, 1),
|
|
|
|
|
"IDI",
|
|
|
|
|
"IDI",
|
|
|
|
|
"IDI"
|
|
|
|
|
))->setIngredient("D", Item::get(Item::DIAMOND, 0, 3))->setIngredient("I", Item::get(Item::IRON_INGOT, 0, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::TRAPDOOR, 0, 2),
|
|
|
|
|
"PPP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, null, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOODEN_DOOR, 0, 1),
|
|
|
|
|
"PP",
|
|
|
|
|
"PP",
|
|
|
|
|
"PP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, null, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOODEN_STAIRS, 0, 4),
|
|
|
|
|
" P",
|
|
|
|
|
" PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::OAK, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::OAK, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::OAK, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::SPRUCE_WOOD_STAIRS, 0, 4),
|
|
|
|
|
" P",
|
|
|
|
|
" PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::SPRUCE, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::SPRUCE, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BIRCH_WOOD_STAIRS, 0, 4),
|
|
|
|
|
" P",
|
|
|
|
|
" PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::BIRCH, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::BIRCH, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::JUNGLE_WOOD_STAIRS, 0, 4),
|
|
|
|
|
"P",
|
|
|
|
|
"PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::JUNGLE, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::JUNGLE, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::ACACIA_WOOD_STAIRS, 0, 4),
|
|
|
|
|
" P",
|
|
|
|
|
" PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::ACACIA, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::ACACIA, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::DARK_OAK_WOOD_STAIRS, 0, 4),
|
|
|
|
|
" P",
|
|
|
|
|
" PP",
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 6)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::WOOD_SLAB, Planks::DARK_OAK, 6),
|
|
|
|
|
"PPP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, Planks::DARK_OAK, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BUCKET, 0, 1),
|
|
|
|
|
"I I",
|
|
|
|
|
" I"
|
|
|
|
|
))->setIngredient("I", Item::get(Item::IRON_INGOT, 0, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::CLOCK, 0, 1),
|
|
|
|
|
" G",
|
|
|
|
|
"GR",
|
|
|
|
|
" G"
|
|
|
|
|
))->setIngredient("G", Item::get(Item::GOLD_INGOT, 0, 4))->setIngredient("R", Item::get(Item::REDSTONE_DUST, 0, 1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::COMPASS, 0, 1),
|
|
|
|
|
" I ",
|
|
|
|
|
"IRI",
|
|
|
|
|
" I"
|
|
|
|
|
))->setIngredient("I", Item::get(Item::IRON_INGOT, 0, 4))->setIngredient("R", Item::get(Item::REDSTONE_DUST, 0, 1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::TNT, 0, 1),
|
|
|
|
|
"GSG",
|
|
|
|
|
"SGS",
|
|
|
|
|
"GSG"
|
|
|
|
|
))->setIngredient("G", Item::get(Item::GUNPOWDER, 0, 5))->setIngredient("S", Item::get(Item::SAND, null, 4)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BOWL, 0, 4),
|
|
|
|
|
"P P",
|
|
|
|
|
" P"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANKS, null, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::MINECART, 0, 1),
|
|
|
|
|
"I I",
|
|
|
|
|
"III"
|
|
|
|
|
))->setIngredient("I", Item::get(Item::IRON_INGOT, 0, 5)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BOOK, 0, 1),
|
|
|
|
|
"P P",
|
|
|
|
|
" P "
|
|
|
|
|
))->setIngredient("P", Item::get(Item::PAPER, 0, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::BOOKSHELF, 0, 1),
|
|
|
|
|
"PBP",
|
|
|
|
|
"PBP",
|
|
|
|
|
"PBP"
|
|
|
|
|
))->setIngredient("P", Item::get(Item::WOODEN_PLANK, null, 6))->setIngredient("B", Item::get(Item::BOOK, 0, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::PAINTING, 0, 1),
|
|
|
|
|
"SSS",
|
|
|
|
|
"SWS",
|
|
|
|
|
"SSS"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 8))->setIngredient("W", Item::get(Item::WOOL, null, 1)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new ShapedRecipe(Item::get(Item::PAPER, 0, 3),
|
|
|
|
|
"SS",
|
|
|
|
|
"S"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::SUGARCANE, 0, 3)));
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::SIGN, 0, 3),
|
|
|
|
|
"PPP",
|
|
|
|
|
"PPP",
|
|
|
|
|
" S"
|
|
|
|
|
))->setIngredient("S", Item::get(Item::STICK, 0, 1))->setIngredient("P", Item::get(Item::WOODEN_PLANKS, null, 6))); //TODO: check if it gives one sign or three
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new BigShapedRecipe(Item::get(Item::IRON_BARS, 0, 16),
|
|
|
|
|
"III",
|
|
|
|
|
"III",
|
|
|
|
|
"III"
|
|
|
|
|
))->setIngredient("I", Item::get(Item::IRON_INGOT, 0, 9)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function registerFurnace(){
|
|
|
|
@ -185,38 +387,142 @@ class CraftingManager{
|
|
|
|
|
$this->registerRecipe(new FurnaceRecipe(Item::get(Item::HARDENED_CLAY, 0, 1), Item::get(Item::CLAY_BLOCK, 0, 1)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function registerStonecutter(){
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::QUARTZ_BLOCK, 0, 1)))->addIngredient(Item::get(Item::QUARTZ, 0, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::BRICK_STAIRS, 0, 4)))->addIngredient(Item::get(Item::BRICKS_BLOCK, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::BRICKS_BLOCK, 0, 1)))->addIngredient(Item::get(Item::BRICK, 0, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 4, 6)))->addIngredient(Item::get(Item::BRICKS_BLOCK, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::QUARTZ_BLOCK, 1, 1)))->addIngredient(Item::get(Item::SLAB, 6, 2)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 3, 6)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::COBBLESTONE_WALL, 0, 6)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::COBBLESTONE_WALL, 1, 6)))->addIngredient(Item::get(Item::MOSS_STONE, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::NETHER_BRICKS, 0, 1)))->addIngredient(Item::get(Item::NETHER_BRICK, 0, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::NETHER_BRICKS_STAIRS, 0, 4)))->addIngredient(Item::get(Item::NETHER_BRICKS, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::QUARTZ_BLOCK, 2, 2)))->addIngredient(Item::get(Item::QUARTZ_BLOCK, 0, 2)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 6, 6)))->addIngredient(Item::get(Item::QUARTZ_BLOCK, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SANDSTONE_STAIRS, 0, 4)))->addIngredient(Item::get(Item::SANDSTONE, 0, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SANDSTONE, 0, 1)))->addIngredient(Item::get(Item::SAND, 0, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SANDSTONE, 2, 4)))->addIngredient(Item::get(Item::SANDSTONE, 0, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SANDSTONE, 1, 1)))->addIngredient(Item::get(Item::SLAB, 1, 2)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 1, 6)))->addIngredient(Item::get(Item::SANDSTONE, 0, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE_BRICK_STAIRS, 0, 4)))->addIngredient(Item::get(Item::STONE_BRICK, null, 6)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE_BRICK, 0, 4)))->addIngredient(Item::get(Item::STONE, null, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE_BRICK, 3, 1)))->addIngredient(Item::get(Item::SLAB, 5, 2)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE_BRICK, 1, 1)))->addIngredient(Item::get(Item::STONE_BRICK, 0, 1))->addIngredient(Item::get(Item::VINES, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 5, 6)))->addIngredient(Item::get(Item::STONE_BRICK, null, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::SLAB, 0, 6)))->addIngredient(Item::get(Item::STONE, null, 3)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::COBBLESTONE_STAIRS, 0, 4)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 6)));
|
|
|
|
|
protected function registerStonecutter(){
|
|
|
|
|
$shapes = [
|
|
|
|
|
"slab" => [
|
|
|
|
|
" ",
|
|
|
|
|
"XXX",
|
|
|
|
|
" "
|
|
|
|
|
],
|
|
|
|
|
"stairs" => [
|
|
|
|
|
"X ",
|
|
|
|
|
"XX ",
|
|
|
|
|
"XXX"
|
|
|
|
|
],
|
|
|
|
|
"wall/fence" => [
|
|
|
|
|
"XXX",
|
|
|
|
|
"XXX",
|
|
|
|
|
" "
|
|
|
|
|
],
|
|
|
|
|
"blockrecipe1" => [
|
|
|
|
|
"XX",
|
|
|
|
|
"XX"
|
|
|
|
|
],
|
|
|
|
|
"blockrecipe2X1" => [
|
|
|
|
|
" ",
|
|
|
|
|
" X ",
|
|
|
|
|
" X "
|
|
|
|
|
],
|
|
|
|
|
"blockrecipe2X2" => [
|
|
|
|
|
"AB",
|
|
|
|
|
"BA"
|
|
|
|
|
],
|
|
|
|
|
"blockrecipe1X2" => [
|
|
|
|
|
" ",
|
|
|
|
|
"AB"
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::POLISHED_GRANITE, 4)))->addIngredient(Item::get(Item::STONE, Stone::GRANITE, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::POLISHED_DIORITE, 4)))->addIngredient(Item::get(Item::STONE, Stone::DIORITE, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::POLISHED_ANDESITE, 4)))->addIngredient(Item::get(Item::STONE, Stone::ANDESITE, 4)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::GRANITE, 1)))->addIngredient(Item::get(Item::STONE, Stone::DIORITE, 1))->addIngredient(Item::get(Item::QUARTZ, 0, 1)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::DIORITE, 2)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 2))->addIngredient(Item::get(Item::QUARTZ, 0, 2)));
|
|
|
|
|
$this->registerRecipe((new StonecutterShapelessRecipe(Item::get(Item::STONE, Stone::ANDESITE, 2)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 1))->addIngredient(Item::get(Item::STONE, Stone::DIORITE, 1)));
|
|
|
|
|
$buildRecipes = [];
|
|
|
|
|
|
|
|
|
|
// Single ingedient stone cutter recipes:
|
|
|
|
|
$RESULT_ITEMID = 0; $RESULT_META = 1; $INGREDIENT_ITEMID = 2; $INGREDIENT_META = 3; $RECIPE_SHAPE = 4;$RESULT_AMOUNT = 5;
|
|
|
|
|
$recipes = [
|
|
|
|
|
//RESULT_ITEM_ID RESULT_META INGREDIENT_ITEMID INGREDIENT_META RECIPE_SHAPE RESULT_AMOUNT
|
|
|
|
|
[Item::SLAB, Slab::STONE, Item::STONE, Stone::NORMAL, "slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::COBBLESTONE, Item::COBBLESTONE, 0, "slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::SANDSTONE, Item::SANDSTONE, 0, "slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::BRICK, Item::BRICK, 0, "slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::STONE_BRICK, Item::STONE_BRICK, StoneBricks::NORMAL,"slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::NETHER_BRICK, Item::NETHER_BRICK_BLOCK, 0, "slab", 6],
|
|
|
|
|
[Item::SLAB, Slab::QUARTZ, Item::QUARTZ_BLOCK, 0, "slab", 6],
|
|
|
|
|
[Item::COBBLESTONE_STAIRS, 0, Item::COBBLESTONE, 0, "stairs", 4],
|
|
|
|
|
[Item::SANDSTONE_STAIRS, 0, Item::SANDSTONE, 0, "stairs", 4],
|
|
|
|
|
[Item::STONE_BRICK_STAIRS, 0, Item::STONE_BRICK, StoneBricks::NORMAL,"stairs", 4],
|
|
|
|
|
[Item::BRICK_STAIRS, 0, Item::BRICKS_BLOCK, 0, "stairs", 4],
|
|
|
|
|
[Item::NETHER_BRICKS_STAIRS,0, Item::NETHER_BRICK_BLOCK, 0, "stairs", 4],
|
|
|
|
|
[Item::COBBLESTONE_WALL, StoneWall::NONE_MOSSY_WALL, Item::COBBLESTONE, 0, "wall/fence", 6],
|
|
|
|
|
[Item::COBBLESTONE_WALL, StoneWall::MOSSY_WALL, Item::MOSSY_STONE, 0, "wall/fence", 6],
|
|
|
|
|
[Item::NETHER_BRICK_FENCE, 0, Item::NETHER_BRICK_BLOCK, 0, "wall/fence", 6],
|
|
|
|
|
[Item::NETHER_BRICKS, 0, Item::NETHER_BRICK, 0, "blockrecipe1", 1],
|
|
|
|
|
[Item::SANDSTONE, SandStone::NORMAL, Item::SAND, 0, "blockrecipe1", 1],
|
|
|
|
|
[Item::SANDSTONE, Sandstone::CHISELED, Item::SANDSTONE, SandStone::NORMAL, "blockrecipe1", 4],
|
|
|
|
|
[Item::STONE_BRICK, StoneBricks::NORMAL, Item::STONE, Stone::NORMAL, "blockrecipe1", 4],
|
|
|
|
|
[Item::STONE_BRICK, StoneBricks::NORMAL, Item::STONE, Stone::POLISHED_GRANITE,"blockrecipe1", 4],
|
|
|
|
|
[Item::STONE_BRICK, StoneBricks::NORMAL, Item::STONE, Stone::POLISHED_DIORITE,"blockrecipe1", 4],
|
|
|
|
|
[Item::STONE_BRICK, StoneBricks::NORMAL, Item::STONE, Stone::POLISHED_ANDESITE,"blockrecipe1",4],
|
|
|
|
|
[Item::STONE, Stone::POLISHED_GRANITE, Item::STONE, Stone::GRANITE, "blockrecipe1", 4],
|
|
|
|
|
[Item::STONE, Stone::POLISHED_DIORITE, Item::STONE, Stone::DIORITE, "blockrecipe1", 4],
|
|
|
|
|
[Item::STONE, Stone::POLISHED_ANDESITE, Item::STONE, Stone::ANDESITE, "blockrecipe1", 4],
|
|
|
|
|
[Item::QUARTZ_BLOCK, Quartz::QUARTZ_NORMAL, Item::QUARTZ, Stone::ANDESITE, "blockrecipe1", 4],
|
|
|
|
|
[Item::QUARTZ_BLOCK, Quartz::QUARTZ_CHISELED, Item::SLAB, Slab::QUARTZ, "blockrecipe2X1", 1],
|
|
|
|
|
[Item::SANDSTONE, SandStone::CHISELED, Item::SLAB, Slab::SANDSTONE, "blockrecipe2X1", 1],
|
|
|
|
|
[Item::STONE_BRICK, StoneBricks::CHISELED, Item::SLAB, Slab::STONE_BRICK, "blockrecipe2X1", 1],
|
|
|
|
|
];
|
|
|
|
|
foreach ($recipes as $recipe){
|
|
|
|
|
$buildRecipes[] = $this->createOneIngedientRecipe($shapes[$recipe[$RECIPE_SHAPE]], $recipe[$RESULT_ITEMID], $recipe[$RESULT_META], $recipe[$RESULT_AMOUNT], $recipe[$INGREDIENT_ITEMID], $recipe[$INGREDIENT_META], "X", "Stonecutter");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Multi-ingredient stone recipes:
|
|
|
|
|
$buildRecipes[] = ((new StonecutterShapedRecipe(Item::get(Item::STONE, Stone::GRANITE, 1),
|
|
|
|
|
...$shapes["blockrecipe1X2"]
|
|
|
|
|
))->setIngredient("A", Item::get(Item::STONE, Stone::DIORITE, 1))->setIngredient("B", Item::get(Item::QUARTZ, Quartz::QUARTZ_NORMAL, 1)));
|
|
|
|
|
$buildRecipes[] = ((new StonecutterShapedRecipe(Item::get(Item::STONE, Stone::DIORITE, 2),
|
|
|
|
|
...$shapes["blockrecipe2X2"]
|
|
|
|
|
))->setIngredient("A", Item::get(Item::COBBLESTONE, 0, 2))->setIngredient("B", Item::get(Item::QUARTZ, 0, 2)));
|
|
|
|
|
$buildRecipes[] = ((new StonecutterShapedRecipe(Item::get(Item::STONE, Stone::ANDESITE, 2),
|
|
|
|
|
...$shapes["blockrecipe1X2"]
|
|
|
|
|
))->setIngredient("A", Item::get(Item::COBBLESTONE, 0, 1))->setIngredient("B", Item::get(Item::STONE, Stone::DIORITE, 1)));
|
|
|
|
|
$buildRecipes[] = ((new StonecutterShapedRecipe(Item::get(Item::STONE_BRICK, StoneBricks::MOSSY, 1),
|
|
|
|
|
...$shapes["blockrecipe1X2"]
|
|
|
|
|
))->setIngredient("A", Item::get(Item::STONE_BRICK, StoneBricks::NORMAL, 1))->setIngredient("B", Item::get(Item::VINES, 0, 1)));
|
|
|
|
|
|
|
|
|
|
$this->sortAndAddRecipesArray($buildRecipes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function sortAndAddRecipesArray(&$recipes){
|
|
|
|
|
// Sort the recipes based on the result item name with the bubblesort algoritm.
|
|
|
|
|
for ($i = 0; $i < count($recipes); ++$i){
|
|
|
|
|
$current = $recipes[$i];
|
|
|
|
|
$result = $current->getResult();
|
|
|
|
|
for ($j = count($recipes)-1; $j > $i; --$j)
|
|
|
|
|
{
|
|
|
|
|
if ($this->sort($result, $recipes[$j]->getResult())>0){
|
|
|
|
|
$swap = $current;
|
|
|
|
|
$current = $recipes[$j];
|
|
|
|
|
$recipes[$j] = $swap;
|
|
|
|
|
$result = $current->getResult();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->registerRecipe($current);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function createOneIngedientRecipe($recipeshape, $resultitem, $resultitemmeta, $resultitemamound, $ingedienttype, $ingredientmeta, $ingredientname, $inventoryType = ""){
|
|
|
|
|
$ingredientamount = 0;
|
|
|
|
|
$height = 0;
|
|
|
|
|
// count how many of the ingredient are in the recipe and check height for big or small recipe.
|
|
|
|
|
foreach ($recipeshape as $line){
|
|
|
|
|
$height += 1;
|
|
|
|
|
$width = strlen($line);
|
|
|
|
|
$ingredientamount += substr_count($line, $ingredientname);
|
|
|
|
|
}
|
|
|
|
|
$recipe = null;
|
|
|
|
|
if ($height < 3){
|
|
|
|
|
// Process small recipe
|
|
|
|
|
$fullClassName = "pocketmine\\inventory\\".$inventoryType."ShapedRecipe";// $ShapeClass."ShapedRecipe";
|
|
|
|
|
$recipe = ((new $fullClassName(Item::get($resultitem, $resultitemmeta, $resultitemamound),
|
|
|
|
|
...$recipeshape
|
|
|
|
|
))->setIngredient($ingredientname, Item::get($ingedienttype, $ingredientmeta, $ingredientamount)));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
// Process big recipe
|
|
|
|
|
$fullClassName = "pocketmine\\inventory\\".$inventoryType."BigShapedRecipe";
|
|
|
|
|
$recipe = ((new $fullClassName(Item::get($resultitem, $resultitemmeta, $resultitemamound),
|
|
|
|
|
...$recipeshape
|
|
|
|
|
))->setIngredient($ingredientname, Item::get($ingedienttype, $ingredientmeta, $ingredientamount)));
|
|
|
|
|
}
|
|
|
|
|
return $recipe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function registerFood(){
|
|
|
|
|