mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Add getInventory() to Container interface where it's actually useful
This commit is contained in:
parent
1323d89139
commit
1fb6d12a6b
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user