mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Assemble 1.21.30 (#6453)
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user