This commit is contained in:
Dylan K. Taylor 2022-07-17 21:24:27 +01:00
parent 012b668537
commit 172bd9a129
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -28,8 +28,8 @@ use pocketmine\data\bedrock\item\ItemSerializer;
use pocketmine\data\bedrock\item\ItemTypeDeserializeException; use pocketmine\data\bedrock\item\ItemTypeDeserializeException;
use pocketmine\data\bedrock\item\ItemTypeSerializeException; use pocketmine\data\bedrock\item\ItemTypeSerializeException;
use pocketmine\data\bedrock\item\SavedItemData; use pocketmine\data\bedrock\item\SavedItemData;
use pocketmine\data\bedrock\item\SavedItemStackData;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\serializer\ItemTypeDictionary; use pocketmine\network\mcpe\protocol\serializer\ItemTypeDictionary;
use pocketmine\utils\AssumptionFailedError; use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\SingletonTrait; use pocketmine\utils\SingletonTrait;
@ -100,11 +100,11 @@ final class ItemTranslator{
/** /**
* @throws ItemTypeSerializeException * @throws ItemTypeSerializeException
*/ */
public function toNetworkNbt(Item $item) : SavedItemStackData{ public function toNetworkNbt(Item $item) : CompoundTag{
//TODO: this relies on the assumption that network item NBT is the same as disk item NBT, which may not always //TODO: this relies on the assumption that network item NBT is the same as disk item NBT, which may not always
//be true - if we stick on an older world version while updating network version, this could be a problem (and //be true - if we stick on an older world version while updating network version, this could be a problem (and
//may be a problem for multi version implementations) //may be a problem for multi version implementations)
return $this->itemSerializer->serializeStack($item); return $this->itemSerializer->serializeStack($item)->toNbt();
} }
/** /**