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

@ -145,7 +145,7 @@ abstract class Living extends Entity{
$this->effectManager->getEffectAddHooks()->add(function() : void{ $this->networkPropertiesDirty = true; });
$this->effectManager->getEffectRemoveHooks()->add(function() : void{ $this->networkPropertiesDirty = true; });
$this->armorInventory = new ArmorInventory($this);
$this->armorInventory = new ArmorInventory();
//TODO: load/save armor inventory contents
$this->armorInventory->getListeners()->add(CallbackInventoryListener::onAnyChange(fn() => NetworkBroadcastUtils::broadcastEntityEvent(
$this->getViewers(),
@ -928,7 +928,6 @@ abstract class Living extends Entity{
protected function destroyCycles() : void{
unset(
$this->armorInventory,
$this->effectManager
);
parent::destroyCycles();