First look: Split up Inventory & InventoryWindow

this unblocks a variety of changes, such as positionless tiles, enhanced APIs on Blocks for inventories, and also eliminates a bunch of cyclic references within the core code.

linked to #5033
This commit is contained in:
Dylan K. Taylor
2024-11-24 21:40:47 +00:00
parent 473bbe64e0
commit 45a4282e8b
74 changed files with 827 additions and 933 deletions

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\inventory\CraftingTableInventory;
use pocketmine\block\inventory\CraftingTableInventoryWindow;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
@@ -32,7 +32,7 @@ class CraftingTable extends Opaque{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
if($player instanceof Player){
$player->setCurrentWindow(new CraftingTableInventory($this->position));
$player->setCurrentWindow(new CraftingTableInventoryWindow($player, $this->position));
}
return true;