Ejemplo n.º 1
0
        public override void Load(TagCompound tag)
        {
            // cross compat. from 0.1.3
            if (tag.Any(x => x.Value is float))
            {
                if (tag.ContainsKey("amplitude"))
                {
                    amplitude = (double)tag.GetAsShort("amplitude");
                }
                if (tag.ContainsKey("speed"))
                {
                    speed = (double)tag.GetAsShort("speed");
                }
                if (tag.ContainsKey("universalOffset"))
                {
                    bounceOffset = (double)tag.GetAsShort("universalOffset");
                }
                if (tag.ContainsKey("bounceEvenly"))
                {
                    bounceEvenly = tag.Get <bool>("bounceEvenly");
                }
                if (tag.ContainsKey("disallowModItems"))
                {
                    bounceModItems = !tag.Get <bool>("disallowModItems");
                }
            }
            else
            {
                if (tag.ContainsKey("amplitude"))
                {
                    amplitude = tag.GetAsDouble("amplitude");
                }
                if (tag.ContainsKey("ampMult"))
                {
                    ampMult = tag.GetAsDouble("ampMult");
                }
                if (tag.ContainsKey("speed"))
                {
                    speed = tag.GetAsDouble("speed");
                }
                if (tag.ContainsKey("bounceOffset"))
                {
                    bounceOffset = tag.GetAsDouble("bounceOffset");
                }

                if (tag.ContainsKey("bounceEvenly"))
                {
                    bounceEvenly = tag.Get <bool>("bounceEvenly");
                }
                if (tag.ContainsKey("bounceModItems"))
                {
                    bounceModItems = tag.Get <bool>("bounceModItems");
                }
                if (tag.ContainsKey("byCosine"))
                {
                    byCosine = tag.Get <bool>("byCosine");
                }

                if (tag.ContainsKey("modVersion"))
                {
                    modVersion = ConstrucModversion(tag.GetString("modVersion"));
                }
            }

            if (tag.ContainsKey("bouncyItems"))
            {
                bouncyItems = new List <int>(tag.GetList <int>("bouncyItems"));
            }
        }