diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 2b56a0e3c..5edd234e8 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -557,10 +557,6 @@ class Item implements ItemIds, \JsonSerializable{ * @return $this */ public function setCount(int $count) : Item{ - if($count < 0 or $count > 255){ - throw new \InvalidArgumentException("Count must be in the range 0-255"); - } - $this->count = $count; return $this; diff --git a/tests/phpunit/item/ItemTest.php b/tests/phpunit/item/ItemTest.php index 69ce1ab4e..d84449269 100644 --- a/tests/phpunit/item/ItemTest.php +++ b/tests/phpunit/item/ItemTest.php @@ -89,18 +89,4 @@ class ItemTest extends TestCase{ self::assertEquals($id, $item->getId()); self::assertEquals($meta, $item->getDamage()); } - - public function testSetCountTooBig() : void{ - $this->expectException(\InvalidArgumentException::class); - - $item = ItemFactory::get(ItemIds::STONE); - $item->setCount(256); - } - - public function testSetCountTooSmall() : void{ - $this->expectException(\InvalidArgumentException::class); - - $item = ItemFactory::get(ItemIds::STONE); - $item->setCount(-1); - } }