public static ChestRule Deserialize(TagCompound tag) { var rule = new ChestRuleGuaranteed(); rule.pool = DeserializePool(tag.GetCompound("Pool")); return(rule); }
public override ChestRule Clone() { var clone = new ChestRuleGuaranteed(); for (int k = 0; k < pool.Count; k++) { clone.pool.Add(pool[k].Clone()); } return(clone); }
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); }