Example #1
0
        public static ChestRule Deserialize(TagCompound tag)
        {
            var rule = new ChestRuleGuaranteed();

            rule.pool = DeserializePool(tag.GetCompound("Pool"));

            return(rule);
        }
Example #2
0
        public override ChestRule Clone()
        {
            var clone = new ChestRuleGuaranteed();

            for (int k = 0; k < pool.Count; k++)
            {
                clone.pool.Add(pool[k].Clone());
            }

            return(clone);
        }
Example #3
0
        public static ChestRule Deserialize(TagCompound tag)
        {
            string str = tag.GetString("Type");

            ChestRule rule;

            switch (str)
            {
            case "Guaranteed": rule = ChestRuleGuaranteed.Deserialize(tag); break;

            case "Chance": rule = ChestRuleChance.Deserialize(tag); break;

            case "Pool": rule = ChestRulePool.Deserialize(tag); break;

            case "PoolChance": rule = ChestRulePoolChance.Deserialize(tag); break;

            default: rule = null; break;
            }

            return(rule);
        }