예제 #1
0
 public override void FromBytes(BinaryReader reader, IWorldAccessor resolver)
 {
     particlePos = Vec3d.CreateFromBytes(reader);
     blockpos    = BlockPos.CreateFromBytes(reader);
     quantity    = reader.ReadInt32();
     radius      = reader.ReadSingle();
     scale       = reader.ReadSingle();
     if (reader.ReadBoolean())
     {
         velocity = Vec3f.CreateFromBytes(reader);
     }
 }
예제 #2
0
 public override void FromBytes(BinaryReader reader, IWorldAccessor resolver)
 {
     collisionPos = Vec3d.CreateFromBytes(reader);
     stack        = new ItemStack();
     stack.FromBytes(reader);
     stack.ResolveBlockOrItem(resolver);
     quantity = reader.ReadInt32();
     radius   = reader.ReadSingle();
     scale    = reader.ReadSingle();
     if (reader.ReadBoolean())
     {
         velocity = Vec3f.CreateFromBytes(reader);
     }
 }
예제 #3
0
        public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
        {
            MinQuantity       = reader.ReadSingle();
            AddQuantity       = reader.ReadSingle();
            MinPos            = Vec3d.CreateFromBytes(reader);
            AddPos            = Vec3d.CreateFromBytes(reader);
            MinVelocity       = Vec3f.CreateFromBytes(reader);
            AddVelocity       = Vec3f.CreateFromBytes(reader);
            LifeLength        = reader.ReadSingle();
            GravityEffect     = reader.ReadSingle();
            MinSize           = reader.ReadSingle();
            MaxSize           = reader.ReadSingle();
            Color             = reader.ReadInt32();
            VertexFlags       = reader.ReadInt32();
            ParticleModel     = (EnumParticleModel)reader.ReadInt32();
            ShouldDieInAir    = reader.ReadBoolean();
            ShouldDieInLiquid = reader.ReadBoolean();

            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);
            }


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


            SelfPropelled = reader.ReadBoolean();

            if (!reader.ReadBoolean())
            {
                ColorByBlock = resolver.Blocks[reader.ReadInt32()];
            }

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

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