Skip to content

Commit 29cfd65

Browse files
committed
revert SymplyShapedRecipe and SymplyShapelessRecipe classes
Sorry for the inconvenience.
1 parent 14ba634 commit 29cfd65

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/*
4+
*
5+
* _____ _____ _ ______ _____ _ _ _____ _ _ _____
6+
* /\ |_ _| __ \ | | | ____| /\ | __ \| \ | |_ _| \ | |/ ____|
7+
* / \ | | | | | |______| | | |__ / \ | |__) | \| | | | | \| | | __
8+
* / /\ \ | | | | | |______| | | __| / /\ \ | _ /| . ` | | | | . ` | | |_ |
9+
* / ____ \ _| |_| |__| | | |____| |____ / ____ \| | \ \| |\ |_| |_| |\ | |__| |
10+
* /_/ \_\_____|_____/ |______|______/_/ \_\_| \_\_| \_|_____|_| \_|\_____|
11+
*
12+
* This program is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Lesser General Public License as published by
14+
* the Free Software Foundation, either version 3 of the License, or
15+
* (at your option) any later version.
16+
*
17+
* @author AID-LEARNING
18+
* @link https://github.com/AID-LEARNING
19+
*
20+
*/
21+
22+
declare(strict_types=1);
23+
24+
namespace SenseiTarzan\SymplyPlugin\Manager\Component;
25+
26+
use pocketmine\crafting\RecipeIngredient;
27+
use pocketmine\crafting\ShapedRecipe;
28+
use pocketmine\item\Item;
29+
30+
class SymplyShapedRecipe extends ShapedRecipe
31+
{
32+
33+
private string $type;
34+
35+
/**
36+
* Constructs a ShapedRecipe instance.
37+
*
38+
* @param string[] $shape <br>
39+
* Array of 1, 2, or 3 strings representing the rows of the recipe.
40+
* This accepts an array of 1, 2 or 3 strings. Each string should be of the same length and must be at most 3
41+
* characters long. Each character represents a unique type of ingredient. Spaces are interpreted as air.
42+
* @param RecipeIngredient[] $ingredients <br>
43+
* Char => Item map of items to be set into the shape.
44+
* This accepts an array of Items, indexed by character. Every unique character (except space) in the shape
45+
* array MUST have a corresponding item in this list. Space character is automatically treated as air.
46+
* @param Item[] $results List of items that this recipe produces when crafted.
47+
*
48+
* Note: Recipes **do not** need to be square. Do NOT add padding for empty rows/columns.
49+
*/
50+
public function __construct(array $shape, array $ingredients, array $results, string $type)
51+
{
52+
$this->type = $type;
53+
parent::__construct($shape, $ingredients, $results);
54+
}
55+
56+
public function getType() : string
57+
{
58+
return $this->type;
59+
}
60+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/*
4+
*
5+
* _____ _____ _ ______ _____ _ _ _____ _ _ _____
6+
* /\ |_ _| __ \ | | | ____| /\ | __ \| \ | |_ _| \ | |/ ____|
7+
* / \ | | | | | |______| | | |__ / \ | |__) | \| | | | | \| | | __
8+
* / /\ \ | | | | | |______| | | __| / /\ \ | _ /| . ` | | | | . ` | | |_ |
9+
* / ____ \ _| |_| |__| | | |____| |____ / ____ \| | \ \| |\ |_| |_| |\ | |__| |
10+
* /_/ \_\_____|_____/ |______|______/_/ \_\_| \_\_| \_|_____|_| \_|\_____|
11+
*
12+
* This program is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Lesser General Public License as published by
14+
* the Free Software Foundation, either version 3 of the License, or
15+
* (at your option) any later version.
16+
*
17+
* @author AID-LEARNING
18+
* @link https://github.com/AID-LEARNING
19+
*
20+
*/
21+
22+
declare(strict_types=1);
23+
24+
namespace SenseiTarzan\SymplyPlugin\Manager\Component;
25+
26+
use pocketmine\crafting\RecipeIngredient;
27+
use pocketmine\crafting\ShapelessRecipe;
28+
use pocketmine\crafting\ShapelessRecipeType;
29+
use SenseiTarzan\SymplyPlugin\Behavior\Items\Item;
30+
31+
class SymplyShapelessRecipe extends ShapelessRecipe
32+
{
33+
private string $typeFake;
34+
35+
/**
36+
* @param RecipeIngredient[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array.
37+
* @param Item[] $results List of result items created by this recipe.
38+
*/
39+
public function __construct(array $ingredients, array $results, string $typeFake){
40+
$this->typeFake = $typeFake;
41+
parent::__construct($ingredients, $results, ShapelessRecipeType::CRAFTING);
42+
}
43+
44+
public function getTypeFake() : string
45+
{
46+
return $this->typeFake;
47+
}
48+
}

0 commit comments

Comments
 (0)