Assemble 1.21.30 (#6453)

This commit is contained in:
Dries C
2024-09-21 01:47:25 +02:00
committed by GitHub
parent 00e39821f0
commit 60cac18104
17 changed files with 156 additions and 205 deletions

View File

@ -54,6 +54,7 @@ use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\Enchant;
use pocketmine\network\mcpe\protocol\types\EnchantOption as ProtocolEnchantOption;
use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds;
use pocketmine\network\mcpe\protocol\types\inventory\FullContainerName;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\network\mcpe\protocol\types\inventory\NetworkInventoryAction;
@ -500,16 +501,18 @@ class InventoryManager{
$this->session->sendDataPacket(InventorySlotPacket::create(
$windowId,
$netSlot,
new ItemStackWrapper(0, ItemStack::null()),
0
new FullContainerName($this->lastInventoryNetworkId),
0,
new ItemStackWrapper(0, ItemStack::null())
));
}
//now send the real contents
$this->session->sendDataPacket(InventorySlotPacket::create(
$windowId,
$netSlot,
$itemStackWrapper,
0
new FullContainerName($this->lastInventoryNetworkId),
0,
$itemStackWrapper
));
}
@ -528,10 +531,11 @@ class InventoryManager{
$this->session->sendDataPacket(InventoryContentPacket::create(
$windowId,
array_fill_keys(array_keys($itemStackWrappers), new ItemStackWrapper(0, ItemStack::null())),
new FullContainerName($this->lastInventoryNetworkId),
0
));
//now send the real contents
$this->session->sendDataPacket(InventoryContentPacket::create($windowId, $itemStackWrappers, 0));
$this->session->sendDataPacket(InventoryContentPacket::create($windowId, $itemStackWrappers, new FullContainerName($this->lastInventoryNetworkId), 0));
}
public function syncSlot(Inventory $inventory, int $slot, ItemStack $itemStack) : void{