Added API method Item->pop()

This commit is contained in:
Dylan K. Taylor
2017-09-27 10:55:50 +01:00
parent 7a77bb0402
commit c47f1f572c
6 changed files with 27 additions and 35 deletions

View File

@ -1823,10 +1823,7 @@ class Level implements ChunkManager, Metadatable{
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, 1, $hand->getId());
}
$item->setCount($item->getCount() - 1);
if($item->getCount() <= 0){
$item = ItemFactory::get(Item::AIR, 0, 0);
}
$item->pop();
return true;
}