TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ GenerateWorld()

void Terraria.WorldBuilding.WorldGenerator.GenerateWorld ( GenerationProgress progress = null)
inline

Definition at line 33 of file WorldGenerator.cs.

34 {
35 Stopwatch stopwatch = new Stopwatch();
36 double num = 0.0;
37 foreach (GenPass pass in _passes)
38 {
39 num += pass.Weight;
40 }
41 if (progress == null)
42 {
43 progress = new GenerationProgress();
44 }
46 progress.TotalWeight = num;
47 foreach (GenPass pass2 in _passes)
48 {
49 WorldGen._genRand = new UnifiedRandom(_seed);
50 Main.rand = new UnifiedRandom(_seed);
51 stopwatch.Start();
52 progress.Start(pass2.Weight);
53 try
54 {
55 pass2.Apply(progress, _configuration.GetPassConfiguration(pass2.Name));
56 }
57 catch (Exception e)
58 {
59 Utils.ShowFancyErrorMessage(string.Join("\n", Language.GetTextValue("tModLoader.WorldGenError"), pass2.Name, e), 0);
60 throw;
61 }
62 progress.End();
63 stopwatch.Reset();
64 }
66 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
readonly WorldGenConfiguration _configuration
static GenerationProgress CurrentGenerationProgress

References Terraria.WorldBuilding.WorldGenerator._configuration, Terraria.WorldBuilding.WorldGenerator._passes, Terraria.WorldBuilding.WorldGenerator._seed, Terraria.WorldBuilding.WorldGenerator.CurrentGenerationProgress, Terraria.Localization.Language.GetTextValue(), and Terraria.Utils.ShowFancyErrorMessage().

Referenced by Terraria.WorldGen.GenerateWorld_RunTasksAndFinish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: