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:
Dylan K. Taylor
2021-12-07 00:41:07 +00:00
parent ce54d268f2
commit ed4978c31b
14 changed files with 32 additions and 25 deletions

View File

@ -26,7 +26,7 @@ namespace pocketmine\inventory\transaction\action;
use pocketmine\event\player\PlayerDropItemEvent;
use pocketmine\inventory\transaction\TransactionValidationException;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\item\VanillaItems;
use pocketmine\player\Player;
/**
@ -35,7 +35,7 @@ use pocketmine\player\Player;
class DropItemAction extends InventoryAction{
public function __construct(Item $targetItem){
parent::__construct(ItemFactory::air(), $targetItem);
parent::__construct(VanillaItems::AIR(), $targetItem);
}
public function validate(Player $source) : void{