Ejemplo n.º 1
0
        /// <summary>
        /// Deserializes the alloy
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="resolver"></param>
        public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
        {
            Ingredients = new MetalAlloyIngredient[reader.ReadInt32()];

            for (int i = 0; i < Ingredients.Length; i++)
            {
                Ingredients[i] = new MetalAlloyIngredient();
                Ingredients[i].FromBytes(reader, resolver.ClassRegistry);
                Ingredients[i].Resolve(resolver, "[FromBytes]");
            }

            Output = new JsonItemStack();
            Output.FromBytes(reader, resolver.ClassRegistry);
            Output.Resolve(resolver, "[FromBytes]");
        }
Ejemplo n.º 2
0
        public override void FromBytes(BinaryReader reader, IClassRegistryAPI instancer)
        {
            base.FromBytes(reader, instancer);

            if (!reader.ReadBoolean())
            {
                ShapeElement = reader.ReadString();
            }

            if (!reader.ReadBoolean())
            {
                TextureMapping = new string[] { reader.ReadString(), reader.ReadString() };
            }

            if (!reader.ReadBoolean())
            {
                CookedStack = new JsonItemStack();
                CookedStack.FromBytes(reader, instancer);
            }
        }