public static void SaveToBin(Player item, BinaryWriter writer)
        {
            PackedInt.SaveToBin(item.GetSizeOfData(), writer);
            writer.Write(item.HasUUID);
            if (item.HasUUID)
            {
                for (int i = 0; i < UUID_LENGTH; i++)
                {
                    if (i >= 0 && i < item.UUID.Length)
                    {
                        writer.Write(item.UUID[i]);
                    }
                    else
                    {
                        writer.Write((byte)30);
                    }
                }
            }

            Humanoid.SaveToBin(item.HumanoidEntity, writer);
            EntityStatus.SaveToBin(item.DefaultStatus, writer);
            Status.SaveToBin(item.CurrentStatus, writer);
            StringIO.SaveToBin(item.Description, writer);
            writer.Write(item.PlayingTime);
            PlayerInventory.SaveToBin(item.Inventory, writer);
            BlueprintData.SaveToBin(item.Blueprints, writer);
            TechController.SaveToBin(item.Tech, writer);
            Armor.SaveToBin(item.EquippedArmor, writer);
            Item.SaveToBin(item.LeftHandItem, writer);
            Item.SaveToBin(item.RightHandItem, writer);
        }
        public static Player LoadFromBin(BinaryReader reader)
        {
            Player result = new Player();

            PackedInt lengthOfData = PackedInt.LoadFromBin(reader);

            result.HasUUID = reader.ReadBoolean();
            if (result.HasUUID)
            {
                result.UUID = new byte[UUID_LENGTH];

                for (int i = 0; i < UUID_LENGTH; i++)
                {
                    result.UUID[i] = reader.ReadByte();
                }
            }

            result.HumanoidEntity = Humanoid.LoadFromBin(reader);
            result.DefaultStatus  = EntityStatus.LoadFromBin(reader);
            result.CurrentStatus  = Status.LoadFromBin(reader);
            result.Description    = StringIO.LoadFromBin(reader);
            result.PlayingTime    = reader.ReadDouble();
            result.Inventory      = PlayerInventory.LoadFromBin(reader);
            result.Blueprints     = BlueprintData.LoadFromBin(reader);
            result.Tech           = TechController.LoadFromBin(reader);
            result.EquippedArmor  = Armor.LoadFromBin(reader);
            result.LeftHandItem   = Item.LoadFromBin(reader);
            result.RightHandItem  = Item.LoadFromBin(reader);

            return(result);
        }
        public static void SaveToBin(BlueprintData item, BinaryWriter writer)
        {
            PackedInt.SaveToBin(item.GetSizeOfData(), writer);
            PackedInt.SaveToBin(new PackedInt()
            {
                Value = (ulong)item.Blueprints.Count
            }, writer);

            for (int i = 0; i < item.Blueprints.Count; i++)
            {
                Item.SaveToBin(item.Blueprints[i], writer);
            }
        }
        public static BlueprintData LoadFromBin(BinaryReader reader)
        {
            BlueprintData result = new BlueprintData();

            PackedInt dataLength    = PackedInt.LoadFromBin(reader);
            PackedInt numBlueprints = PackedInt.LoadFromBin(reader);

            for (ulong i = 0; i < numBlueprints.Value; i++)
            {
                result.Blueprints.Add(Item.LoadFromBin(reader));
            }

            return(result);
        }