mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Removed ext-ds dependency
This commit is contained in:
@ -23,9 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\crafting;
|
||||
|
||||
use Ds\Set;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\utils\DestructorCallbackTrait;
|
||||
use pocketmine\utils\ObjectSet;
|
||||
use function json_encode;
|
||||
use function usort;
|
||||
|
||||
@ -41,13 +41,13 @@ class CraftingManager{
|
||||
protected $furnaceRecipeManager;
|
||||
|
||||
/**
|
||||
* @var Set
|
||||
* @phpstan-var Set<\Closure() : void>
|
||||
* @var ObjectSet
|
||||
* @phpstan-var ObjectSet<\Closure() : void>
|
||||
*/
|
||||
private $recipeRegisteredCallbacks;
|
||||
|
||||
public function __construct(){
|
||||
$this->recipeRegisteredCallbacks = new Set();
|
||||
$this->recipeRegisteredCallbacks = new ObjectSet();
|
||||
$this->furnaceRecipeManager = new FurnaceRecipeManager();
|
||||
$this->furnaceRecipeManager->getRecipeRegisteredCallbacks()->add(function(FurnaceRecipe $recipe) : void{
|
||||
foreach($this->recipeRegisteredCallbacks as $callback){
|
||||
@ -56,8 +56,8 @@ class CraftingManager{
|
||||
});
|
||||
}
|
||||
|
||||
/** @phpstan-return Set<\Closure() : void> */
|
||||
public function getRecipeRegisteredCallbacks() : Set{ return $this->recipeRegisteredCallbacks; }
|
||||
/** @phpstan-return ObjectSet<\Closure() : void> */
|
||||
public function getRecipeRegisteredCallbacks() : ObjectSet{ return $this->recipeRegisteredCallbacks; }
|
||||
|
||||
/**
|
||||
* Function used to arrange Shapeless Recipe ingredient lists into a consistent order.
|
||||
|
@ -23,27 +23,27 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\crafting;
|
||||
|
||||
use Ds\Set;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\utils\ObjectSet;
|
||||
|
||||
final class FurnaceRecipeManager{
|
||||
/** @var FurnaceRecipe[] */
|
||||
protected $furnaceRecipes = [];
|
||||
|
||||
/**
|
||||
* @var Set
|
||||
* @phpstan-var Set<\Closure(FurnaceRecipe) : void>
|
||||
* @var ObjectSet
|
||||
* @phpstan-var ObjectSet<\Closure(FurnaceRecipe) : void>
|
||||
*/
|
||||
private $recipeRegisteredCallbacks;
|
||||
|
||||
public function __construct(){
|
||||
$this->recipeRegisteredCallbacks = new Set();
|
||||
$this->recipeRegisteredCallbacks = new ObjectSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return Set<\Closure(FurnaceRecipe) : void>
|
||||
* @phpstan-return ObjectSet<\Closure(FurnaceRecipe) : void>
|
||||
*/
|
||||
public function getRecipeRegisteredCallbacks() : Set{
|
||||
public function getRecipeRegisteredCallbacks() : ObjectSet{
|
||||
return $this->recipeRegisteredCallbacks;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user