mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Merge branch 'stable' into minor-next
This commit is contained in:
commit
c6a09e5ed8
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockTypeIds;
|
||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||
|
||||
/**
|
||||
@ -58,4 +59,12 @@ final class ItemBlock extends Item{
|
||||
public function getMaxStackSize() : int{
|
||||
return $this->block->getMaxStackSize();
|
||||
}
|
||||
|
||||
public function isNull() : bool{
|
||||
//TODO: we really shouldn't need to treat air as a special case here
|
||||
//this is needed because the "null" empty slot item is represented by an air block, but there's no real reason
|
||||
//why air should be needed at all. A separate special item type (or actual null) should be used instead, but
|
||||
//this would cause a lot of BC breaks, so we can't do it yet.
|
||||
return parent::isNull() || $this->block->getTypeId() === BlockTypeIds::AIR;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user