mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Inventory: Removed need for Inventory to have an InventoryHolder
Inventory holders are now freed from BaseInventory. They are now declared by subclasses by convention, but are not required in most cases. Ideally, this would be followed by the removal of the need for inventories to know their holders at all. They should just be simple containers of items. This fixes #1560 by removing FakeBlockMenu.
This commit is contained in:
@ -24,16 +24,17 @@ declare(strict_types=1);
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\network\mcpe\protocol\types\WindowTypes;
|
||||
use pocketmine\tile\EnderChest;
|
||||
|
||||
class EnderChestInventory extends ChestInventory{
|
||||
|
||||
/** @var FakeBlockMenu */
|
||||
/** @var Position */
|
||||
protected $holder;
|
||||
|
||||
public function __construct(Human $owner){
|
||||
ContainerInventory::__construct(new FakeBlockMenu($this, $owner->getPosition()));
|
||||
ContainerInventory::__construct(new Position());
|
||||
}
|
||||
|
||||
public function getNetworkType() : int{
|
||||
@ -60,7 +61,7 @@ class EnderChestInventory extends ChestInventory{
|
||||
|
||||
/**
|
||||
* This override is here for documentation and code completion purposes only.
|
||||
* @return FakeBlockMenu
|
||||
* @return Position
|
||||
*/
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
|
Reference in New Issue
Block a user