diff --git a/src/pocketmine/block/Crops.php b/src/pocketmine/block/Crops.php index 32852472b..eaebfe0a2 100644 --- a/src/pocketmine/block/Crops.php +++ b/src/pocketmine/block/Crops.php @@ -55,7 +55,7 @@ abstract class Crops extends Flowable{ $this->getLevel()->setBlock($this, $ev->getNewState(), true, true); } - $item->count--; + $item->pop(); return true; } diff --git a/src/pocketmine/block/Grass.php b/src/pocketmine/block/Grass.php index e7ccfa040..afd4b54ad 100644 --- a/src/pocketmine/block/Grass.php +++ b/src/pocketmine/block/Grass.php @@ -99,7 +99,7 @@ class Grass extends Solid{ public function onActivate(Item $item, Player $player = null) : bool{ if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){ - $item->count--; + $item->pop(); TallGrassObject::growGrass($this->getLevel(), $this, new Random(mt_rand()), 8, 2); return true; diff --git a/src/pocketmine/block/Sapling.php b/src/pocketmine/block/Sapling.php index 43737f80c..682f2251a 100644 --- a/src/pocketmine/block/Sapling.php +++ b/src/pocketmine/block/Sapling.php @@ -72,7 +72,7 @@ class Sapling extends Flowable{ //TODO: change log type Tree::growTree($this->getLevel(), $this->x, $this->y, $this->z, new Random(mt_rand()), $this->getVariant()); - $item->count--; + $item->pop(); return true; } diff --git a/src/pocketmine/block/Sugarcane.php b/src/pocketmine/block/Sugarcane.php index 884715e93..ad4e95aff 100644 --- a/src/pocketmine/block/Sugarcane.php +++ b/src/pocketmine/block/Sugarcane.php @@ -62,7 +62,7 @@ class Sugarcane extends Flowable{ $this->getLevel()->setBlock($this, $this, true); } - $item->count--; + $item->pop(); return true; } diff --git a/src/pocketmine/item/PaintingItem.php b/src/pocketmine/item/PaintingItem.php index 89ec034ea..115dba494 100644 --- a/src/pocketmine/item/PaintingItem.php +++ b/src/pocketmine/item/PaintingItem.php @@ -96,7 +96,7 @@ class PaintingItem extends Item{ $entity = Entity::createEntity("Painting", $blockReplace->getLevel(), $nbt); if($entity instanceof Entity){ - --$this->count; + $this->pop(); $entity->spawnToAll(); $player->getLevel()->broadcastLevelEvent($blockReplace->add(0.5, 0.5, 0.5), LevelEventPacket::EVENT_SOUND_ITEMFRAME_PLACE); //item frame and painting have the same sound diff --git a/src/pocketmine/item/ProjectileItem.php b/src/pocketmine/item/ProjectileItem.php index 79a437811..f0f0860cc 100644 --- a/src/pocketmine/item/ProjectileItem.php +++ b/src/pocketmine/item/ProjectileItem.php @@ -54,7 +54,7 @@ abstract class ProjectileItem extends Item{ $projectile->setMotion($projectile->getMotion()->multiply($this->getThrowForce())); } - $this->count--; + $this->pop(); if($projectile instanceof Projectile){ $projectileEv = new ProjectileLaunchEvent($projectile); diff --git a/src/pocketmine/item/SpawnEgg.php b/src/pocketmine/item/SpawnEgg.php index 175ddc58a..92ac5d4a1 100644 --- a/src/pocketmine/item/SpawnEgg.php +++ b/src/pocketmine/item/SpawnEgg.php @@ -44,7 +44,7 @@ class SpawnEgg extends Item{ $entity = Entity::createEntity($this->meta, $player->getLevel(), $nbt); if($entity instanceof Entity){ - --$this->count; + $this->pop(); $entity->spawnToAll(); return true; }