Inventory: remove dropContents(), remove circular dependency

This commit is contained in:
Dylan K. Taylor 2019-02-16 11:54:09 +00:00
parent f49d590794
commit 0ac7164b16
2 changed files with 0 additions and 28 deletions

View File

@ -26,8 +26,6 @@ namespace pocketmine\inventory;
use pocketmine\event\inventory\InventoryOpenEvent;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\level\Level;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\InventoryContentPacket;
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
@ -146,21 +144,6 @@ abstract class BaseInventory implements Inventory{
}
}
/**
* Drops the contents of the inventory into the specified Level at the specified position and clears the inventory
* contents.
*
* @param Level $level
* @param Vector3 $position
*/
public function dropContents(Level $level, Vector3 $position) : void{
foreach($this->getContents() as $item){
$level->dropItem($position, $item);
}
$this->clearAll();
}
public function setItem(int $index, Item $item, bool $send = true) : bool{
if($item->isNull()){
$item = ItemFactory::get(Item::AIR, 0, 0);

View File

@ -27,8 +27,6 @@ declare(strict_types=1);
namespace pocketmine\inventory;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\Vector3;
use pocketmine\Player;
interface Inventory{
@ -122,15 +120,6 @@ interface Inventory{
*/
public function setContents(array $items, bool $send = true) : void;
/**
* Drops the contents of the inventory into the specified Level at the specified position and clears the inventory
* contents.
*
* @param Level $level
* @param Vector3 $position
*/
public function dropContents(Level $level, Vector3 $position) : void;
/**
* @param Player|Player[] $target
*/