Remove circular dependency between Item and NBT modules (#121)

This commit is contained in:
Dylan K. Taylor
2016-11-25 10:17:50 +00:00
committed by GitHub
parent a0111d04ee
commit e51a2725de
7 changed files with 68 additions and 64 deletions

View File

@ -1454,7 +1454,7 @@ class Level implements ChunkManager, Metadatable{
*/
public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null, int $delay = 10){
$motion = $motion === null ? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1) : $motion;
$itemTag = NBT::putItemHelper($item);
$itemTag = $item->nbtSerialize();
$itemTag->setName("Item");
if($item->getId() > 0 and $item->getCount() > 0){