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); } }
public override void ToBytes(BinaryWriter writer) { collisionPos.ToBytes(writer); stack.ToBytes(writer); writer.Write(quantity); writer.Write(radius); writer.Write(scale); }
/// <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); } }
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); } }
/// <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); } }