Add getInventory() to Container interface where it's actually useful

This commit is contained in:
Dylan K. Taylor 2017-09-19 19:26:41 +01:00
parent 1323d89139
commit 1fb6d12a6b
2 changed files with 8 additions and 2 deletions

View File

@ -44,7 +44,6 @@ use pocketmine\event\level\SpawnChangeEvent;
use pocketmine\event\LevelTimings;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\Timings;
use pocketmine\inventory\InventoryHolder;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\level\format\Chunk;
@ -84,6 +83,7 @@ use pocketmine\Player;
use pocketmine\plugin\Plugin;
use pocketmine\Server;
use pocketmine\tile\Chest;
use pocketmine\tile\Container;
use pocketmine\tile\Tile;
use pocketmine\utils\Random;
use pocketmine\utils\ReversePriorityQueue;
@ -1618,7 +1618,7 @@ class Level implements ChunkManager, Metadatable{
$tile = $this->getTile($target);
if($tile !== null){
if($tile instanceof InventoryHolder){
if($tile instanceof Container){
if($tile instanceof Chest){
$tile->unpair();
}

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\tile;
use pocketmine\inventory\Inventory;
use pocketmine\item\Item;
interface Container{
@ -44,4 +45,9 @@ interface Container{
* @return int
*/
public function getSize() : int;
/**
* @return Inventory
*/
public function getInventory();
}