Protocol changes for 1.16.0

This commit is contained in:
Dylan K. Taylor
2020-06-26 12:46:52 +01:00
parent c616d9bb7c
commit e990c5a0a5
81 changed files with 3026 additions and 184 deletions

View File

@@ -31,7 +31,9 @@ use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\InventoryContentPacket;
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\Player;
use function array_map;
use function array_slice;
use function count;
use function max;
@@ -433,7 +435,7 @@ abstract class BaseInventory implements Inventory{
}
$pk = new InventoryContentPacket();
$pk->items = $this->getContents(true);
$pk->items = array_map([ItemStackWrapper::class, 'legacy'], $this->getContents(true));
foreach($target as $player){
if(($id = $player->getWindowId($this)) === ContainerIds::NONE){
@@ -455,7 +457,7 @@ abstract class BaseInventory implements Inventory{
$pk = new InventorySlotPacket();
$pk->inventorySlot = $index;
$pk->item = $this->getItem($index);
$pk->item = ItemStackWrapper::legacy($this->getItem($index));
foreach($target as $player){
if(($id = $player->getWindowId($this)) === ContainerIds::NONE){