public static AdvancedParticleProperties createFromBytes(BinaryReader reader, IWorldAccessor resolver)
        {
            AdvancedParticleProperties temp = new AdvancedParticleProperties();

            temp.FromBytes(reader, resolver);
            return(temp);
        }
        public AdvancedParticleProperties Clone()
        {
            AdvancedParticleProperties cloned = new AdvancedParticleProperties();

            // Because I'm lazy
            using (MemoryStream ms = new MemoryStream())
            {
                BinaryWriter writer = new BinaryWriter(ms);
                ToBytes(writer);
                ms.Position = 0; // Dunno if needed
                cloned.FromBytes(new BinaryReader(ms), null);
            }

            return(cloned);
        }
        public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
        {
            basePos = new Vec3d(reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble());

            DieInAir      = reader.ReadBoolean();
            DieInLiquid   = reader.ReadBoolean();
            SwimOnLiquid  = reader.ReadBoolean();
            HsvaColor     = new NatFloat[] { NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader) };
            GravityEffect = NatFloat.createFromBytes(reader);
            LifeLength    = NatFloat.createFromBytes(reader);
            PosOffset     = new NatFloat[] { NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader) };
            Quantity      = NatFloat.createFromBytes(reader);
            Size          = NatFloat.createFromBytes(reader);
            Velocity      = new NatFloat[] { NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader), NatFloat.createFromBytes(reader) };
            ParticleModel = (EnumParticleModel)reader.ReadByte();
            VertexFlags   = reader.ReadInt32();

            if (!reader.ReadBoolean())
            {
                OpacityEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                RedEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                GreenEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                BlueEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            SizeEvolve.FromBytes(reader);
            SelfPropelled    = reader.ReadBoolean();
            TerrainCollision = reader.ReadBoolean();
            ColorByBlock     = reader.ReadBoolean();

            if (reader.ReadBoolean())
            {
                VelocityEvolve = new EvolvingNatFloat[]
                {
                    EvolvingNatFloat.createIdentical(0),
                    EvolvingNatFloat.createIdentical(0),
                    EvolvingNatFloat.createIdentical(0),
                };

                VelocityEvolve[0].FromBytes(reader);
                VelocityEvolve[1].FromBytes(reader);
                VelocityEvolve[2].FromBytes(reader);
            }
            SecondarySpawnInterval = NatFloat.createFromBytes(reader);
            int secondaryPropCount = reader.ReadInt32();

            if (secondaryPropCount > 0)
            {
                SecondaryParticles = new AdvancedParticleProperties[secondaryPropCount];
                for (int i = 0; i < secondaryPropCount; i++)
                {
                    SecondaryParticles[i] = AdvancedParticleProperties.createFromBytes(reader, resolver);
                }
            }

            int deathPropCount = reader.ReadInt32();

            if (deathPropCount > 0)
            {
                DeathParticles = new AdvancedParticleProperties[deathPropCount];
                for (int i = 0; i < deathPropCount; i++)
                {
                    DeathParticles[i] = AdvancedParticleProperties.createFromBytes(reader, resolver);
                }
            }

            WindAffectednes = reader.ReadSingle();
        }