internal void generateDimension() { WorldFile.saveWorld(false, true); WorldGen.clearWorld(); generator.GenerateDimension(Main.rand.Next()); itemUseCooldown = 500; WorldGen.EveryTileFrame(); }
public void ModifyGenerationPass(int seed, GenerationProgress customProgressObject) { AddGenerationPass("Terrain", initialShaping); AddGenerationPass("Carving the mountain", Shaping); AddGenerationPass("Shaping the spawn", shapeSpawn); AddGenerationPass("Shaping ocean floor", shapingTheFloor); AddGenerationPass("Filling the ocean", generateSea); AddGenerationPass("Settle liquid", settleLiquid); WorldGen.EveryTileFrame(); }
private void generateDimension() { WorldFile.saveWorld(false, true); WorldGen.clearWorld(); SolarWorldGen.GenerateSolarWorld(-1); itemUseCooldown = 500; //TUAWorld.solarWorldGen(mod); WorldGen.EveryTileFrame(); }
public void Load() { Dimlibs.Instance.Logger.Info(Path.Combine(Main.ActiveWorldFileData.Path.Replace(".wld", ""), ActiveDimensionName.Split(':')[1]) + "\\Trueheader.data"); if (!File.Exists(Path.Combine(Main.ActiveWorldFileData.Path.Replace(".wld", ""), ActiveDimensionName.Split(':')[1]) + "\\Trueheader.data") || !Directory.Exists(Path.Combine(Main.ActiveWorldFileData.Path.Replace(".wld", ""), ActiveDimensionName.Split(':')[1]))) { Console.WriteLine("I'm a bitch"); Directory.CreateDirectory(Path.Combine(Main.ActiveWorldFileData.Path.Replace(".wld", ""), ActiveDimensionName.Split(':')[1])); Dimlibs.dimensionInstanceHandlers[ActiveDimensionName].GenerateDimension(Main.ActiveWorldFileData.Seed, new GenerationProgress()); } bool[] importance = null; int[] position = null; loading = true; ILog log = LogManager.GetLogger("logger"); Console.Write("Loading dimension..."); log.Info("Loading save file header..."); LoadFileFormatTrueHeader(out importance, out position); log.Info("Loading world size data..."); LoadHeader(); log.Info("Attempting to load NPC data"); LoadNPC(); log.Info("Loading the tile, really important"); LoadTile(importance); log.Info("Loading chest data"); LoadChests(); log.Info("Loading modded data"); LoadModdedStuff(); //Still need to do TileEntity log.Info("done"); if (Main.netMode == 0) { WorldGen.EveryTileFrame(); Main.LocalPlayer.Spawn(); } Console.Write("Done"); loading = false; }
public override bool UseItem(Player player) { DimPlayer p = player.GetModPlayer <DimPlayer>(); FieldInfo info = typeof(FileData).GetField("_path", BindingFlags.Instance | BindingFlags.NonPublic); string get = (string)info.GetValue(Main.ActiveWorldFileData); if (itemUseCooldown == 0) { WorldFile.saveWorld(false, true); if (p.getCurrentDimension() != dimensionName) { p.setCurrentDimension(dimensionName); if (dimensionMessage != null) { Main.NewText("Get dunked m8", Color.Orange); } else { Main.NewText("You are entering into a custom dimension...", Color.Orange); } if (!File.Exists(Main.SavePath + "/World/" + (dimensionName + "/" + Main.worldName + ".wld").Replace(' ', '_'))) { info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/" + (dimensionName + "/" + Main.worldName + ".wld").Replace(' ', '_')); generateDimension(); p.player.Spawn(); return(true); } info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/" + (dimensionName + "/" + Main.worldName + ".wld").Replace(' ', '_')); itemUseCooldown = 500; WorldGen.EveryTileFrame(); WorldGen.playWorld(); return(true); } info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/" + (Main.worldName + ".wld").Replace(' ', '_')); p.setCurrentDimension("overworld"); itemUseCooldown = 500; WorldGen.playWorld(); return(true); } return(false); }
public override bool UseItem(Player player) { TUAPlayer p = player.GetModPlayer <TUAPlayer>(mod); FieldInfo info = typeof(FileData).GetField("_path", BindingFlags.Instance | BindingFlags.NonPublic); string get = (string)info.GetValue(Main.ActiveWorldFileData); if (itemUseCooldown == 0) { WorldFile.saveWorld(false, true); if (p.currentDimension != "solar") { p.currentDimension = "solar"; Main.NewText("You are entering into the solar dimension...", Color.Orange); if (!File.Exists(Main.SavePath + "/World/Solar/" + Main.worldName + ".wld")) { info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/Solar/" + Main.worldName + ".wld"); generateDimension(); p.player.Spawn(); return(true); } info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/Solar/" + Main.worldName + ".wld"); itemUseCooldown = 500; WorldGen.EveryTileFrame(); WorldGen.playWorld(); return(true); } info.SetValue(Main.ActiveWorldFileData, Main.SavePath + "/World/" + Main.worldName + ".wld"); p.currentDimension = "overworld"; itemUseCooldown = 500; WorldGen.playWorld(); return(true); } return(false); }