mostly rewrite internal entity metadata handling

- Only sync the metadata set when needed for sending
- Don't use metadata set for storing data, add properties instead
- Use objects inside metadata sets instead of arrays
This commit is contained in:
Dylan K. Taylor
2019-07-28 19:40:47 +01:00
parent 6c0ae6bf0b
commit e06ab0869a
32 changed files with 958 additions and 450 deletions

View File

@ -28,6 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\entity\MetadataProperty;
class AddItemActorPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ADD_ITEM_ACTOR_PACKET;
@ -42,7 +43,7 @@ class AddItemActorPacket extends DataPacket implements ClientboundPacket{
public $position;
/** @var Vector3|null */
public $motion;
/** @var array */
/** @var MetadataProperty[] */
public $metadata = [];
/** @var bool */
public $isFromFishing = false;