コード例 #1
0
        public virtual void ToBytes(BinaryWriter writer)
        {
            writer.Write(IsWildCard);
            writer.Write((int)Type);
            writer.Write(Code.ToShortString());
            writer.Write(Quantity);
            if (!IsWildCard)
            {
                ResolvedItemstack.ToBytes(writer);
            }

            writer.Write(IsTool);
            writer.Write(ToolDurabilityCost);

            writer.Write(AllowedVariants != null);
            if (AllowedVariants != null)
            {
                writer.Write(AllowedVariants.Length);
                for (int i = 0; i < AllowedVariants.Length; i++)
                {
                    writer.Write(AllowedVariants[i]);
                }
            }

            writer.Write(ReturnedStack?.ResolvedItemstack != null);
            if (ReturnedStack?.ResolvedItemstack != null)
            {
                ReturnedStack.ToBytes(writer);
            }
        }
コード例 #2
0
ファイル: BlockVoxelParticles.cs プロジェクト: Archina/vsapi
 public override void ToBytes(BinaryWriter writer)
 {
     collisionPos.ToBytes(writer);
     stack.ToBytes(writer);
     writer.Write(quantity);
     writer.Write(radius);
     writer.Write(scale);
 }
コード例 #3
0
 /// <summary>
 /// Saves the ItemStack to file.
 /// </summary>
 /// <param name="writer">The writer to save the item to.</param>
 public virtual void ToBytes(BinaryWriter writer)
 {
     writer.Write((short)Type);
     writer.Write(Code.ToShortString());
     writer.Write(StackSize);
     writer.Write(ResolvedItemstack != null);
     if (ResolvedItemstack != null)
     {
         ResolvedItemstack.ToBytes(writer);
     }
 }
コード例 #4
0
 public override void ToBytes(BinaryWriter writer)
 {
     collisionPos.ToBytes(writer);
     stack.ToBytes(writer);
     writer.Write(quantity);
     writer.Write(radius);
     writer.Write(scale);
     writer.Write(velocity != null);
     if (velocity != null)
     {
         velocity.ToBytes(writer);
     }
 }
コード例 #5
0
 /// <summary>
 /// The save data writer.
 /// </summary>
 /// <param name="writer">The writer to write blocks to.</param>
 public virtual void ToBytes(BinaryWriter writer)
 {
     writer.Write((short)Type);
     writer.Write(Code.ToShortString());
     Quantity.ToBytes(writer);
     ResolvedItemstack.ToBytes(writer);
     writer.Write(LastDrop);
     writer.Write(DropModbyStat != null);
     if (DropModbyStat != null)
     {
         writer.Write(DropModbyStat);
     }
 }