mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Remove potentially problematic ephemeral window creation
this is *probably* fine, but best avoided.
This commit is contained in:
parent
fe1a8d98e7
commit
1738355357
@ -462,8 +462,8 @@ class InGamePacketHandler extends PacketHandler{
|
||||
$droppedItem = $sourceSlotItem->pop($droppedCount);
|
||||
|
||||
$builder = new TransactionBuilder();
|
||||
//TODO: this probably shouldn't be creating an ephemeral window here - it works, but no idea what side effects it might have on the permanent window
|
||||
$builder->getActionBuilder(new PlayerInventoryWindow($this->player, $inventory, PlayerInventoryWindow::TYPE_INVENTORY))->setItem($sourceSlot, $sourceSlotItem);
|
||||
$window = $this->inventoryManager->getInventoryWindow($inventory) ?? throw new AssumptionFailedError("This should never happen");
|
||||
$builder->getActionBuilder($window)->setItem($sourceSlot, $sourceSlotItem);
|
||||
$builder->addAction(new DropItemAction($droppedItem));
|
||||
|
||||
$transaction = new InventoryTransaction($this->player, $builder->generateActions());
|
||||
|
Loading…
x
Reference in New Issue
Block a user