mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Modernize property declarations in pocketmine\crafting namespace
This commit is contained in:
parent
dca457b1e0
commit
b402df8b91
@ -33,17 +33,12 @@ abstract class CraftingGrid extends SimpleInventory{
|
|||||||
public const SIZE_SMALL = 2;
|
public const SIZE_SMALL = 2;
|
||||||
public const SIZE_BIG = 3;
|
public const SIZE_BIG = 3;
|
||||||
|
|
||||||
/** @var int */
|
private int $gridWidth;
|
||||||
private $gridWidth;
|
|
||||||
|
|
||||||
/** @var int|null */
|
private ?int $startX = null;
|
||||||
private $startX;
|
private ?int $xLen = null;
|
||||||
/** @var int|null */
|
private ?int $startY = null;
|
||||||
private $xLen;
|
private ?int $yLen = null;
|
||||||
/** @var int|null */
|
|
||||||
private $startY;
|
|
||||||
/** @var int|null */
|
|
||||||
private $yLen;
|
|
||||||
|
|
||||||
public function __construct(int $gridWidth){
|
public function __construct(int $gridWidth){
|
||||||
$this->gridWidth = $gridWidth;
|
$this->gridWidth = $gridWidth;
|
||||||
|
@ -57,11 +57,8 @@ class CraftingManager{
|
|||||||
*/
|
*/
|
||||||
protected $potionContainerChangeRecipes = [];
|
protected $potionContainerChangeRecipes = [];
|
||||||
|
|
||||||
/**
|
/** @phpstan-var ObjectSet<\Closure() : void> */
|
||||||
* @var ObjectSet
|
private ObjectSet $recipeRegisteredCallbacks;
|
||||||
* @phpstan-var ObjectSet<\Closure() : void>
|
|
||||||
*/
|
|
||||||
private $recipeRegisteredCallbacks;
|
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
$this->recipeRegisteredCallbacks = new ObjectSet();
|
$this->recipeRegisteredCallbacks = new ObjectSet();
|
||||||
|
@ -27,14 +27,11 @@ use pocketmine\item\Item;
|
|||||||
|
|
||||||
class FurnaceRecipe{
|
class FurnaceRecipe{
|
||||||
|
|
||||||
/** @var Item */
|
public function __construct(
|
||||||
private $output;
|
private Item $result,
|
||||||
|
private Item $ingredient
|
||||||
/** @var Item */
|
){
|
||||||
private $ingredient;
|
$this->result = clone $result;
|
||||||
|
|
||||||
public function __construct(Item $result, Item $ingredient){
|
|
||||||
$this->output = clone $result;
|
|
||||||
$this->ingredient = clone $ingredient;
|
$this->ingredient = clone $ingredient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +40,6 @@ class FurnaceRecipe{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getResult() : Item{
|
public function getResult() : Item{
|
||||||
return clone $this->output;
|
return clone $this->result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,8 @@ final class FurnaceRecipeManager{
|
|||||||
/** @var FurnaceRecipe[] */
|
/** @var FurnaceRecipe[] */
|
||||||
protected $furnaceRecipes = [];
|
protected $furnaceRecipes = [];
|
||||||
|
|
||||||
/**
|
/** @phpstan-var ObjectSet<\Closure(FurnaceRecipe) : void> */
|
||||||
* @var ObjectSet
|
private ObjectSet $recipeRegisteredCallbacks;
|
||||||
* @phpstan-var ObjectSet<\Closure(FurnaceRecipe) : void>
|
|
||||||
*/
|
|
||||||
private $recipeRegisteredCallbacks;
|
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
$this->recipeRegisteredCallbacks = new ObjectSet();
|
$this->recipeRegisteredCallbacks = new ObjectSet();
|
||||||
|
@ -34,16 +34,14 @@ use function strpos;
|
|||||||
|
|
||||||
class ShapedRecipe implements CraftingRecipe{
|
class ShapedRecipe implements CraftingRecipe{
|
||||||
/** @var string[] */
|
/** @var string[] */
|
||||||
private $shape = [];
|
private array $shape = [];
|
||||||
/** @var Item[] char => Item map */
|
/** @var Item[] char => Item map */
|
||||||
private $ingredientList = [];
|
private array $ingredientList = [];
|
||||||
/** @var Item[] */
|
/** @var Item[] */
|
||||||
private $results = [];
|
private array $results = [];
|
||||||
|
|
||||||
/** @var int */
|
private int $height;
|
||||||
private $height;
|
private int $width;
|
||||||
/** @var int */
|
|
||||||
private $width;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a ShapedRecipe instance.
|
* Constructs a ShapedRecipe instance.
|
||||||
|
@ -29,9 +29,9 @@ use function count;
|
|||||||
|
|
||||||
class ShapelessRecipe implements CraftingRecipe{
|
class ShapelessRecipe implements CraftingRecipe{
|
||||||
/** @var Item[] */
|
/** @var Item[] */
|
||||||
private $ingredients = [];
|
private array $ingredients = [];
|
||||||
/** @var Item[] */
|
/** @var Item[] */
|
||||||
private $results;
|
private array $results;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Item[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array.
|
* @param Item[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user