mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Return the dropped item entity in Level->dropItem() (#1222)
This commit is contained in:
parent
42fb1d1fef
commit
1a7f567a70
@ -1531,6 +1531,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @param Item $item
|
||||
* @param Vector3 $motion
|
||||
* @param int $delay
|
||||
*
|
||||
* @return DroppedItem|null
|
||||
*/
|
||||
public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null, int $delay = 10){
|
||||
$motion = $motion ?? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1);
|
||||
@ -1559,7 +1561,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
]));
|
||||
|
||||
$itemEntity->spawnToAll();
|
||||
return $itemEntity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user