the great airgapping of recipes and itemstacks

This commit is contained in:
Dylan K. Taylor
2020-04-23 14:11:48 +01:00
parent 843993f02b
commit 18d48869a0
29 changed files with 907 additions and 299 deletions

View File

@@ -41,6 +41,7 @@ use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\network\mcpe\convert\TypeConverter;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
use pocketmine\network\mcpe\protocol\AddPlayerPacket;
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
@@ -403,7 +404,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
$pk->motion = $this->getMotion();
$pk->yaw = $this->location->yaw;
$pk->pitch = $this->location->pitch;
$pk->item = $this->getInventory()->getItemInHand();
$pk->item = TypeConverter::getInstance()->coreItemStackToNet($this->getInventory()->getItemInHand());
$pk->metadata = $this->getSyncedNetworkData(false);
$player->getNetworkSession()->sendDataPacket($pk);

View File

@@ -29,6 +29,7 @@ use pocketmine\event\entity\ItemSpawnEvent;
use pocketmine\event\inventory\InventoryPickupItemEvent;
use pocketmine\item\Item;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\convert\TypeConverter;
use pocketmine\network\mcpe\protocol\AddItemActorPacket;
use pocketmine\network\mcpe\protocol\TakeItemActorPacket;
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
@@ -210,7 +211,7 @@ class ItemEntity extends Entity{
$pk->entityRuntimeId = $this->getId();
$pk->position = $this->location->asVector3();
$pk->motion = $this->getMotion();
$pk->item = $this->getItem();
$pk->item = TypeConverter::getInstance()->coreItemStackToNet($this->getItem());
$pk->metadata = $this->getSyncedNetworkData(false);
$player->getNetworkSession()->sendDataPacket($pk);