ShulkerBoxInventory: fixed inappropriate usage of BlockLegacyIds when comparing item IDS

This commit is contained in:
Dylan K. Taylor 2022-05-21 15:40:25 +01:00
parent 26df37e6ef
commit a45a96b3ee
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -23,9 +23,9 @@ declare(strict_types=1);
namespace pocketmine\block\inventory;
use pocketmine\block\BlockLegacyIds;
use pocketmine\inventory\SimpleInventory;
use pocketmine\item\Item;
use pocketmine\item\ItemIds;
use pocketmine\network\mcpe\protocol\BlockEventPacket;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\world\Position;
@ -50,7 +50,7 @@ class ShulkerBoxInventory extends SimpleInventory implements BlockInventory{
}
public function canAddItem(Item $item) : bool{
if($item->getId() === BlockLegacyIds::UNDYED_SHULKER_BOX || $item->getId() === BlockLegacyIds::SHULKER_BOX){
if($item->getId() === ItemIds::UNDYED_SHULKER_BOX || $item->getId() === ItemIds::SHULKER_BOX){
return false;
}
return parent::canAddItem($item);