mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Added VanillaItems::AIR()
we don't usually add VanillaItems entries for blocks since they already exist in VanillaBlocks, but air has a special use case specifically as an itemstack, so we make an exception for this case.
This commit is contained in:
@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\crafting;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\utils\Utils;
|
||||
use function array_values;
|
||||
use function count;
|
||||
@ -155,7 +155,7 @@ class ShapedRecipe implements CraftingRecipe{
|
||||
|
||||
public function getIngredient(int $x, int $y) : Item{
|
||||
$exists = $this->ingredientList[$this->shape[$y][$x]] ?? null;
|
||||
return $exists !== null ? clone $exists : ItemFactory::air();
|
||||
return $exists !== null ? clone $exists : VanillaItems::AIR();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user