internal List <BiomeData> GetBiomeData() { if (this.TechToCopy != TechType.None && !BiomeData.Any()) { // This will load the games distribution data and then return the biome distribution list for the techtype you tried to copy from if it has one. LootDistributionData data = LootDistributionData.Load("Balance/EntityDistributions"); if (data.GetPrefabData(CraftData.GetClassIdForTechType(TechToCopy), out SrcData srcData)) { return(srcData.distribution); } } return(BiomeData ?? new List <BiomeData>()); }
public static void Load() { LootDistributionData data = LootDistributionData.Load("Balance/EntityDistributions"); List <TechType> Drillables = Enum.GetValues(typeof(TechType)).OfType <TechType>().Where((tt) => tt.AsString().Contains("Drillable")).ToList(); data.GetPrefabData(CraftData.GetClassIdForTechType(TechType.DrillableUranium), out SrcData UraniumData); foreach (TechType techType in Drillables) { string classId = CraftData.GetClassIdForTechType(techType); if (CraftData.GetPrefabForTechType(techType, false) == null) { continue; } if (WorldEntityDatabase.TryGetInfo(classId, out WorldEntityInfo info)) { if (!data.GetPrefabData(classId, out SrcData srcData)) { SMLHelper.V2.Handler.LootDistributionHandler.AddLootDistributionData(classId, UraniumData); } } } }